API reference · Audit logs
Export audit log entries as CSV
/v1/orgs/{org_id}/audit-logs/exportThe entries the same filters select in the list, newest first, as one CSV file streamed until the filters are exhausted (no row cap: narrow large exports with a time range). Operator entries are masked as in the list.
Console session only: no API key can be granted the audit_log:read permission it needs. Requires the audit_log:read permission (a key's scope, or a role that includes it).
Request
Path parameters
org_idstringYour organization. The SDKs and the CLI fill it in from the API key.
ID with prefix org_
Query parameters
actor_kindstringOnly this kind of actor
One of
memberapi_keyplatformsystemactor_idstringOnly this actor: a user ID, an API key ID, a component, or `platform` for platform operators
up to 64 characters
actionstringAn action (`api_key:create`) or every action on a resource (`api_key:*`)
up to 64 characters · pattern ^[a-z_]+:(\*|[a-z_]+)$
target_typestringOnly entries about this kind of resource
up to 64 characters
target_idstringOnly entries about this resource
up to 64 characters
created_afterstring (date-time)Entries at or after this time
created_beforestring (date-time)Entries before this time
cursorstringStart after this entry (`next_cursor` of a list page)
up to 200 characters
Response
200 text (text/csv) — CSV with a header row; `metadata` is a JSON object per row
Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |