Skip to content
Connect an agent
Organisations

Export an organisation's audit log

The audit log oldest first, as JSON Lines or CSV, at most 1000 events an export.

GET/orgs/{org}/audit/export

TL;DR

QuestionAnswer
What does it do?Export an organisation's audit log.
What does it take?org in the path, and actor, action, target, from, to, format, after in the query string.
What does it return?Status 200 with no body.
What can go wrong?400 a filter or the cursor is not valid; 401 not signed in, or the key is not valid; 403 a member or a reader, or a key without audit:read (orgs.forbidden), or a plan without export (plan.audit_not_included); 404 no such organisation, the caller is not a member of it, or the key is another organisation's; 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

The audit log oldest first, as JSON Lines or CSV, at most 1000 events an export. The Plotwork-Next-Cursor header is where the next export starts (send it as after), and Plotwork-More says whether more are waiting. Enterprise only; the owner, admins, or an organisation key with audit:read.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Query parameters

FieldTypeRequiredDescription
actorstringnoAn actor's account or key id, or their address or key name, matched whole and without regard to case.
actionstringnoAn action, or a group of them by its first two parts.
targetstringnoA target's id, or its name, matched whole and without regard to case.
fromstringnoFrom this time on (inclusive).
tostringnoBefore this time (exclusive).
format"csv" | "jsonl"noCSV with a header row, or JSON Lines (one event per line, the shape of plotwork.audit-event.json).
afterstringnoThe Plotwork-Next-Cursor header of the export before, so a poller takes each event once.

Responses

StatusMeaningBody
200The events, streamed.none
400A filter or the cursor is not valid.ErrorResponse
401Not signed in, or the key is not valid.ErrorResponse
403A member or a reader, or a key without audit:read (orgs.forbidden), or a plan without export (plan.audit_not_included).ErrorResponse
404No such organisation, the caller is not a member of it, or the key is another organisation's.ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools