Skip to main content
GET/audit-log

List 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.

Parameters
eventTypequery

Only events whose type starts with this text, taken literally (% and _ are not wildcards). data.write.auth matches data.write.auth.signup and data.write.auth.signin.

actorIdquery

Only events by this actor: an exact principal id, such as a user (usr_...) or a token (tok_...).

afterquery

Only events that happened strictly after this ISO 8601 instant.

beforequery

Only events that happened strictly before this ISO 8601 instant.

limitquery

The most events to return: an integer from 1 to 200.

Default 50.

cursorquery

The meta.cursor.next value from the previous page, to read the next (older) page.

Omit it for the most recent events.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
401K9O_SESSION_EXPIREDThe caller's session or bearer token has expired; re-authenticate to obtain a fresh token.
403K9O_ACCESS_DENIEDThe caller does not hold PROJECT_ADMIN or PROJECT_AUDITOR on this project; those roles are the minimum required to read the audit log.
Response body (200)
data *object[]

The project's audit events, newest first.

When more events match, meta.cursor.next holds the cursor for the next page; otherwise it is null.

id *string

The event id (evt_...).

type *string

The event type, a dotted name.

Filter on it with the eventType query parameter, which matches by prefix.

actorId *any

Who acted: a user (usr_...), a token (tok_...) or another principal id.

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 project, user or gate.

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 type.

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 outcome, status or result detail.

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
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.audit.query()

Showing example in TypeScript

Response example (200)
{
  "data": [
    {
      "id": "string",
      "type": "string",
      "actorId": "string",
      "targetKind": "string",
      "targetId": "string",
      "occurredAt": "string",
      "outcome": "success",
      "requestId": "string",
      "traceId": "string"
    }
  ]
}

More in Audit & Security