Skip to content
Connect an agent
Organisations

Read an organisation's audit log

One page of the audit log, newest first: who did what to what, and when.

GET/orgs/{org}/audit

TL;DR

QuestionAnswer
What does it do?Read an organisation's audit log.
What does it take?org in the path, and actor, action, target, from, to, cursor, limit in the query string.
What does it return?Status 200 with a body of type OrgAuditPage.
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 that keeps no audit log (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

One page of the audit log, newest first: who did what to what, and when. Filter by actor, action or group, target and time. The owner and admins, or an organisation key with audit:read. Pro keeps 30 days, Enterprise 365; Free records nothing.

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).
cursorstringnoThe page's nextCursor from the page before, for the next, older page.
limitintegernoEvents in the page, 1 to 200. Default 50.

Responses

StatusMeaningBody
200The page.OrgAuditPage
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 that keeps no audit log (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

Response body

A 200 answer has the type OrgAuditPage.

FieldTypeRequiredDescription
itemsOrgAuditEvent[]yes
items[].version1yesThe version of this shape. A change that is not only an addition gets a new number.
items[].idstringyes
items[].orgIdstringyes
items[].atstringyesWhen it happened: an ISO 8601 time in UTC with milliseconds.
items[].action"orgs.org.create" | "orgs.org.rename" | "orgs.member.add" | "orgs.member.remove" | "orgs.member.leave" | "orgs.member.role" | "orgs.owner.transfer" | "orgs.invite.create" | "orgs.invite.revoke" | "orgs.invite.accept" | "orgs.key.create" | "orgs.key.reveal" | "orgs.key.revoke" | "orgs.diagram.publish" | "orgs.diagram.update" | "orgs.diagram.edit" | "orgs.diagram.restore" | "orgs.diagram.lock" | "orgs.diagram.unlock" | "orgs.diagram.delete" | "orgs.folder_rule.set" | "orgs.folder_rule.clear" | "orgs.brand.set" | "orgs.brand.clear" | "orgs.icon.set" | "orgs.icon.delete" | "orgs.avatar.set" | "orgs.avatar.clear" | "orgs.style_rules.set" | "orgs.style_rules.clear" | "orgs.settings.editable" | "orgs.settings.publishing" | "orgs.publishing.move" | "orgs.publishing.unpublish" | "orgs.drift.report" | "orgs.drift.settings" | "orgs.integration.create" | "orgs.integration.update" | "orgs.integration.delete" | "orgs.contract.set" | "orgs.contract.end" | "orgs.audit.export" | "orgs.sso.signin" | "orgs.sso.config" | "orgs.sso.domain_add" | "orgs.sso.domain_verify" | "orgs.sso.domain_remove" | "orgs.sso.signin_failed" | "orgs.sso.jit" | "orgs.sso.break_glass" | "orgs.scim.token" | "orgs.scim.user_create" | "orgs.scim.user_update" | "orgs.scim.user_deactivate" | "orgs.scim.user_delete" | "orgs.scim.group" | "orgs.scim.role"yesWhat happened. Never reused for another meaning.
items[].actorobjectyes
items[].actor.kind"user" | "key" | "ci" | "operator"yes
items[].actor.idstring | nullyesThe account id (user), the key id (key, ci), or null (operator).
items[].actor.namestring | nullyesThe address or key name when it was recorded, "Plotwork support" for the operator, null once a deleted account is forgotten.
items[].targetobjectyes
items[].target.type"org" | "member" | "invite" | "key" | "diagram" | "folder" | "brand" | "icon" | "avatar" | "style_rules" | "settings" | "drift" | "contract" | "sso" | nullyes
items[].target.idstring | nullyes
items[].target.namestring | nullyesA member's address, an invited address, a key's, a diagram's or an icon's name, or a folder.
items[].metadataobjectyesA few facts about the event, such as role or keepEditable. Never a diagram source, a key, a token or a color.
items[].ipstring | nullyesThe network the request came from: the IPv4 /24 or the IPv6 /48, never the full address.
items[].userAgentstring | nullyesThe first 200 characters of the user agent.
items[].requestIdstring | nullyesThe request id, which Plotwork support can look up in the API's logs.
nextCursorstring | nullyesSend as cursor for the next, older page; null on the last.
retentionDaysintegeryesHow many days the organisation's plan keeps an event.
canExportbooleanyesWhether the organisation's plan may export the log.

See also

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