# Audit

4 endpoints at `https://api.kosa8.com`, sent with `Authorization: Bearer $KOSA8_API_KEY`. Generated from the API's own [OpenAPI description](https://api.kosa8.com/openapi.json), which a test holds to the router.

## Audit events, newest first[#]

GET`/v1/audit`scope audit:read

Each event has source, from its via.

Parameters

`sandbox_id`query · string

sandbox_id

`actor`query · string

actor

`target`query · string

target

`since`query · string

since

`until`query · string

until

`before_seq`query · string

before_seq

`limit`query · string

limit

`action`query · string

An action, or a prefix ending in * (sandbox.*)

`source`query · "ui" | "key" | "token" | "mcp" | "signin" | "scim" | "system"

Where the change came from: ui (the dashboard), key (an API key: SDK, CLI, CI), token (a capability token), mcp (an AI app), signin, scim (the identity provider), system

`q`query · string

Words to find in the actor, action, target, sandbox or detail

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/audit \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Recompute the org's hash chain[#]

GET`/v1/audit/verify`scope audit:read

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/audit/verify \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Who appears in the audit log, most recent first, with event counts (at most 200)[#]

GET`/v1/audit/actors`scope audit:read

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/audit/actors \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Audit events as NDJSON (or CSV), oldest first, with hashes; takes the list's filters[#]

GET`/v1/audit/export`scope audit:read

Parameters

`format`query · "ndjson" | "jsonl" | "csv"

Default ndjson

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/audit/export \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

---
Source: https://docs.kosa8.com/api/audit/
