List audit events
Read this organisation's audit trail, newest first.
Read this organisation's audit trail, newest first.
One row per state-changing /v2 request, plus a row for every scope denial
and every read of this endpoint. Rows are append-only and hash-chained: use
GET /v2/audit-logs/verify to prove nothing has been edited or removed.
Filter by action (exact) or action_prefix (everything under one
resource, e.g. api_key.), by resource_id to follow one object, by
actor_key_id to follow one API key, and by since/until for a
window. Both timestamps need an explicit offset — a naive one is rejected
rather than guessed at.
total is capped at 100,000. Rows are retained for 400 days by default
and removed after that by a sweep that records what it pruned, so retention
and tampering stay distinguishable.
A row that predates a field, or that cannot be parsed, comes back with
outcome: "unreadable" and only its id and sequence — the endpoint stays
readable during exactly the incident it exists for.
Errors: 400 (bad filter), 401, 403 (missing audit:read), 429, 503 (the log could not be read — deliberately not an empty page).
Rate limit: 1000 requests per minute per organization (bucket default). Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.
v2/audit-logsAuthorization
AuthorizationRequiredBearer <token>
Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.
In: header
Query Parameters
actionAction
Exact action, e.g. 'agent.update'. Takes precedence over action_prefix.
action_prefixAction Prefix
Everything under one resource, e.g. 'agent.' or 'api_key.'. Anchored, so it stays index-backed.
resource_typeResource Type
agent | agent_version | call | batch | api_key | webhook_subscription | inbound_agent | knowledge_base | organization | audit_log
resource_idResource Id
Everything that happened to one object.
outcomeOutcome
success | denied | failure
actor_key_idActor Key Id
Everything one API key did. The 'key_...' id from GET /v2/api-keys.
sinceSince
Inclusive lower bound, ISO-8601 with an explicit offset.
untilUntil
Inclusive upper bound, ISO-8601 with an explicit offset.
organization_idOrganization Id
Must match the organisation the API key belongs to.
pagePage
1-indexed page number (max 10000 — narrow the window instead)
1Minimum: 1Maximum: 10000page_sizePage Size
Items per page (max 100)
20Minimum: 1Maximum: 100Response Body
200
A page of audit events, newest first.
dataRequiredData
This page of audit events, newest first.
paginationRequiredPagination
Where this page sits; 'total' may be capped.
400
1000 — a filter value could not be parsed.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
401
1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
403
1102 — the key is valid but lacks the audit:read scope, or names another organisation.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
422
1001 — a query parameter failed validation; the message names the field.
errorRequiredinteger
Stable integer code from the error table. Branch on this, not on the message.
messageRequiredstring
One human-readable sentence. Wording may change; the code will not.
429
1300 — per-organisation rate limit exceeded. Carries Retry-After.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
503
1501 — the audit log could not be read. Deliberately NOT an empty page.
errorRequiredError
Stable integer code from the /v2 error table. Branch on this.
messageRequiredMessage
One human-readable sentence. Wording may change; the code will not.
A page of audit events, newest first.

