# List Audit Log

`GET /audit-log` · Core · Audit & Security

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

| Name | In | Required | Description |
|---|---|---|---|
| `eventType` | query | no | 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`. |
| `actorId` | query | no | Only events by this actor: an exact principal id, such as a user (`usr_...`) or a token (`tok_...`). |
| `after` | query | no | Only events that happened strictly after this ISO 8601 instant. |
| `before` | query | no | Only events that happened strictly before this ISO 8601 instant. |
| `limit` | query | no | The most events to return: an integer from 1 to 200. Default 50. |
| `cursor` | query | no | The `meta.cursor.next` value from the previous page, to read the next (older) page. Omit it for the most recent events. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | array of object | yes | 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. |
| `data.[]id` | string | yes | The event id (`evt_...`). |
| `data.[]type` | string | yes | The event type, a dotted name. Filter on it with the `eventType` query parameter, which matches by prefix. |
| `data.[]actorId` | object | yes | Who acted: a user (`usr_...`), a token (`tok_...`) or another principal id. Null for an action the platform took itself. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.[]targetKind` | object | yes | The kind of thing the event acted on, such as `project`, `user` or `gate`. Null when the event has no single target. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.[]targetId` | object | yes | The id of the thing the event acted on. Null when the event has no single target. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.[]payload` | object | yes | Details of the event. Its keys depend on `type`. An event with no details has an empty object. |
| `data.[]occurredAt` | string (date-time) | yes | When the event happened. |
| `data.[]outcome` | object | yes | 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_ | | |  |
| _or_ | | |  |
| _or_ | | |  |
| _or_ | | |  |
| `data.[]requestId` | object | yes | The id of the API request that caused the event. Null for an event not caused by a request. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.[]traceId` | object | yes | The trace id of the request that caused the event. Null when none was recorded. |
| _one of_ | | |  |
| _or_ | | |  |
| `meta` | object | yes |  |


## Errors

| HTTP | Code | When |
|---|---|---|
| 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. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/audit-log' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/audit-log', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o audit export <file> --out <out>
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.audit.query()
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.audit.query()
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Audit.Query(ctx)
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.audit.query().await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.audit().query()
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Audit.QueryAsync()
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.audit.query()
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->audit->query()
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/list-audit-log
