/audit-logList Audit Log
Returns a paginated list of audit events for the specified project, covering auth, data-access, security, and lifecycle activity.
Requires PROJECT_ADMIN or PROJECT_AUDITOR minimum; callers below PROJECT_AUDITOR (including PROJECT_EDITOR) receive K9O_ACCESS_DENIED (403).
Supports filtering by eventType (glob patterns accepted), actorId, actorType, after/before timestamp range, and result outcome.
Queries are limited to the hot-tier window; a request spanning more than 90 days returns K9O_AUDIT_LOG_QUERY_WINDOW_TOO_LARGE (400).
Use the export endpoint for larger windows.
| eventType | query | Only events whose type starts with this text, taken literally ( |
| actorId | query | Only events by this actor: an exact principal id, such as a user ( |
| after | query | Only events that happened strictly after this ISO 8601 instant. |
| before | query | Only events that happened strictly before this ISO 8601 instant. |
| limit | query | The most events to return: an integer from 1 to 200. Default 50. |
| cursor | query | The Omit it for the most recent events. |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_SESSION_EXPIRED | The caller's session or bearer token has expired; re-authenticate to obtain a fresh token. |
| 403 | K9O_ACCESS_DENIED | The caller does not hold PROJECT_ADMIN or PROJECT_AUDITOR on this project; those roles are the minimum required to read the audit log. |
| data * | object[] | The project's audit events, newest first. When more events match, |
| id * | string | The event id ( |
| type * | string | The event type, a dotted name. Filter on it with the |
| actorId * | any | Who acted: a user ( Null for an action the platform took itself. |
| One of: string | ||
| or: null | ||
| targetKind * | any | The kind of thing the event acted on, such as Null when the event has no single target. |
| One of: string | ||
| or: null | ||
| targetId * | any | The id of the thing the event acted on. Null when the event has no single target. |
| One of: string | ||
| or: null | ||
| payload * | object | Details of the event. Its keys depend on An event with no details has an empty object. |
| occurredAt * | string <date-time> | When the event happened. |
| outcome * | any | Whether the action succeeded, failed or was denied, read from the event's own Null when the event records none. |
| One of: "success" | ||
| or: "failure" | ||
| or: "denied" | ||
| or: null | ||
| requestId * | any | The id of the API request that caused the event. Null for an event not caused by a request. |
| One of: string | ||
| or: null | ||
| traceId * | any | The trace id of the request that caused the event. Null when none was recorded. |
| One of: string | ||
| or: null | ||
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.audit.query()Showing example in TypeScript
{
"data": [
{
"id": "string",
"type": "string",
"actorId": "string",
"targetKind": "string",
"targetId": "string",
"occurredAt": "string",
"outcome": "success",
"requestId": "string",
"traceId": "string"
}
]
}