curl --request GET \
--url https://{controlPlaneURL}/api/svc/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://{controlPlaneURL}/api/svc/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{controlPlaneURL}/api/svc/v1/audit-logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{controlPlaneURL}/api/svc/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{controlPlaneURL}/api/svc/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{controlPlaneURL}/api/svc/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"action": "APPLY_ACCOUNT",
"requestPath": "<string>",
"resourceId": "<string>",
"resourceType": "role",
"resourceName": "<string>",
"resourceFqn": "<string>",
"parentResourceId": "<string>",
"parentResourceType": "role",
"tenantName": "<string>",
"clusterId": "<string>",
"workspaceId": "<string>",
"subject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"metaData": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"eventSourceMetadata": {},
"message": "<string>"
}
],
"pagination": {
"total": 100,
"offset": 0,
"limit": 10
}
}Get Audit Logs
List audit log entries for the current tenant, newest first. Requires permission to read tenant audit logs; otherwise use get_resource_audit_logs for a resource the caller can manage. Entries record successful changes (creates, updates, deletes, access grants) and token or secret views; failed requests, dry runs and gateway LLM requests are not recorded. Set start and end to keep queries fast, and filter by action, resourceType or subjectSlug; search is slow. Use metric=count for totals. Entries can be large (they include the manifest before and after the change), so keep limit small.
curl --request GET \
--url https://{controlPlaneURL}/api/svc/v1/audit-logs \
--header 'Authorization: Bearer <token>'import requests
url = "https://{controlPlaneURL}/api/svc/v1/audit-logs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{controlPlaneURL}/api/svc/v1/audit-logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{controlPlaneURL}/api/svc/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{controlPlaneURL}/api/svc/v1/audit-logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{controlPlaneURL}/api/svc/v1/audit-logs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/audit-logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"action": "APPLY_ACCOUNT",
"requestPath": "<string>",
"resourceId": "<string>",
"resourceType": "role",
"resourceName": "<string>",
"resourceFqn": "<string>",
"parentResourceId": "<string>",
"parentResourceType": "role",
"tenantName": "<string>",
"clusterId": "<string>",
"workspaceId": "<string>",
"subject": {
"subjectId": "<string>",
"subjectType": "user",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"metaData": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"eventSourceMetadata": {},
"message": "<string>"
}
],
"pagination": {
"total": 100,
"offset": 0,
"limit": 10
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Number of items per page
1 <= x <= 100010
Number of items to skip
x >= 00
list (default) returns entries; count returns only pagination.total.
list, count Action names (comma separated), as returned by get_audit_log_actions.
Search query for message, action, resource name, and resource FQN
Resource Id
Resource Type (comma separated)
Resource Name
Resource Fqn
Cluster Id
Workspace Id
Who performed the action (comma separated): user emails, or virtual account names for virtual accounts.
Start Time (ISO 8601)
End Time (ISO 8601)
Was this page helpful?