import requests
url = "https://platform.ankra.app/api/v1/org/organisation/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://platform.ankra.app/api/v1/org/organisation/audit-logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/organisation/audit-logs \
--header 'Authorization: Bearer <token>'{
"items": [
{
"action_type": "<string>",
"actor": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"autonomy": "<string>",
"email": "<string>",
"origin": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trigger": "<string>",
"type": "agent"
},
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_is_deleted": true,
"cluster_name": "<string>",
"details": {},
"ip_address": "<string>",
"log_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": {
"duration_ms": 123,
"error": "<string>",
"status": "succeeded"
},
"resource_id": "<string>",
"resource_type": "<string>",
"target": {
"kind": "<string>",
"name": "<string>",
"namespace": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z",
"user_email": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}List the organisation audit log with an API token
Bearer twin of GET /org/organisation/audit-logs: the organisation audit log, newest first, paginated with page and page_size (default 50, at most 200), with the actor, agent and target of each row. Accepts a personal or service-account API token; the token (its scopes and its role) must hold audit.read in the organisation. Same filters as the session listing. The organisation is the token’s own, or the one named by the X-Ankra-Organisation-Id header when the token’s user is a member of it; a service-account token cannot leave its organisation. The audit trail belongs to the whole organisation: audit.read cannot be held through a project, so a project-only member’s token is refused, and a token pinned to a project is refused with 403 whatever its holder’s role.
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/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://platform.ankra.app/api/v1/org/organisation/audit-logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/organisation/audit-logs \
--header 'Authorization: Bearer <token>'{
"items": [
{
"action_type": "<string>",
"actor": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"autonomy": "<string>",
"email": "<string>",
"origin": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trigger": "<string>",
"type": "agent"
},
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_is_deleted": true,
"cluster_name": "<string>",
"details": {},
"ip_address": "<string>",
"log_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": {
"duration_ms": 123,
"error": "<string>",
"status": "succeeded"
},
"resource_id": "<string>",
"resource_type": "<string>",
"target": {
"kind": "<string>",
"name": "<string>",
"namespace": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z",
"user_email": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"page": 123,
"page_size": 123,
"total": 123,
"total_pages": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
x <= 200agent, human, service_account, system succeeded, failed Narrow the listing to one cluster's slice of the organisation trail.