Get Resource Audit Logs
curl --request GET \
--url https://{controlPlaneURL}/api/svc/v1/audit-logs/resources \
--header 'Authorization: Bearer <token>'import requests
url = "https://{controlPlaneURL}/api/svc/v1/audit-logs/resources"
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/resources', 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/resources",
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/resources"
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/resources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/audit-logs/resources")
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
}
}Audit Logs
Get Resource Audit Logs
List audit log entries for one resource the caller can manage, newest first. Use this when the caller is not a tenant admin, or when tenant-wide audit logs are not enabled: access follows the resource. Pass resourceType and the id from that resource’s get or list tool. For an application or deployment, pass that id; manage permission on its workspace is enough. A cluster returns every entry in that cluster. A workspace returns the workspace and activity inside it. Other types return the resource and its children. Set start and end, and keep limit small, because each entry includes the manifest before and after the change.
GET
/
api
/
svc
/
v1
/
audit-logs
/
resources
Get Resource Audit Logs
curl --request GET \
--url https://{controlPlaneURL}/api/svc/v1/audit-logs/resources \
--header 'Authorization: Bearer <token>'import requests
url = "https://{controlPlaneURL}/api/svc/v1/audit-logs/resources"
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/resources', 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/resources",
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/resources"
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/resources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/audit-logs/resources")
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
Query Parameters
Type of the resource whose audit log to read.
Available options:
role, account, cluster, workspace, environment, secret-group, deployment, application, secret, docker-registry, tenant, vcs-integration, mlf-project, repository, provider-integration, team, service-account, llm-gateway, policy, role-binding, settings, provider-account, user, alert-config, alert-rule, gateway-config, gateway-controls, gateway-budget, gateway-rate-limit, gateway-policy, gateway-approval-request, tracing-project, tracing-application, agent, agent-channel, gateway-installation, virtual-account, mcp-server, external-identity-provider, agent-identity, oidc-client Was this page helpful?