List audit records
Stored audit records for the key’s own environment, newest first, in the v1 export shape (anlyon.audit.v1). Enterprise edition and Team plan; answers 404 where audit streaming is not included. Needs audit:read, which no key receives by default. Deduplicate on id.
/api/v2/audit/eventsAuthorizationBearer token (Anlyon API key) · headerrequiredWorkspace API key sent as Authorization: Bearer <key>.
better-auth.session_tokenAPI key · cookierequiredBrowser session used by dashboard-only operations.
fromstring<date-time>tostring<date-time>environmentIdstring<uuid>Ignored for an environment-scoped key
typestringComma-separated event types or prefixes, for example approval.*,policy.updated.
categoryAuditCategoryapprovalinvocationpolicyactionaccessenvironmentconnectionlimitauditactionstringA governed action's name or id. Matches records that name it.
endUserIdstringRecords of acts for this end user (or its erased~ hash).
limitintegerbeforeintegerThe sequence of the last record on the previous page.
X-Request-IdstringOptional caller correlation ID. Unsafe or oversized values are replaced.
Audit records, newest first.
successbooleanrequiredtruedataAuditEvent[]requiredShow propertiesHide properties
AuditEventschemastringrequiredanlyon.audit.v1idstringrequiredsequenceintegerrequiredtypestringrequiredcategoryAuditCategoryrequiredapprovalinvocationpolicyactionaccessenvironmentconnectionlimitauditoccurredAtstring<date-time>requiredworkspaceIdstring<uuid>requiredenvironmentIdstring<uuid> | nullrequiredNull for workspace-level records such as members and keys.
actorAuditActorrequiredShow propertiesHide properties
typestringrequireduserapi_keyoauth_clientassistantpolicysystemidstring | nullrequiredUser id
onBehalfOfstring | nullFor an OAuth client
resourceobject | nullrequiredShow propertiesHide properties
typestringrequiredidstringrequiredoutcomestring | nullrequireddataobjectrequiredType-specific detail. Invocation records carry a receipt; approval records carry the policy decision.
contextobject | nullrequiredShow propertiesHide properties
requestIdstringipstringuserAgentstringtestbooleanPresent only on a test event.
truebackfilledbooleanPresent only on a record created from history by the one-time backfill
trueendUserIdstringPresent only on a record of an act for one of your end users. erased~<hash> once that end user is erased.
paginationobjectrequiredShow propertiesHide properties
nextBeforeinteger | nullrequiredPass as before for the next page. Null on the last page.
Bad Request - Invalid input data
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Unauthorized - Invalid or missing API key
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Authenticated credential lacks the required scope or workspace access.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Not Found - Resource does not exist
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.

