# Export an organisation's audit log

> Page: https://docs.plotwork.dev/api/get-orgs-org-audit-export. Index of every page: https://docs.plotwork.dev/llms.txt

The audit log oldest first, as JSON Lines or CSV, at most 1000 events an export.

`GET /orgs/{org}/audit/export`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Export an organisation's audit log. |
| What does it take? | `org` in the path, and `actor`, `action`, `target`, `from`, `to`, `format`, `after` in the query string. |
| What does it return? | Status 200 with no body. |
| What can go wrong? | `400` a filter or the cursor is not valid; `401` not signed in, or the key is not valid; `403` a member or a reader, or a key without `audit:read` (orgs.forbidden), or a plan without export (plan.audit_not_included); `404` no such organisation, the caller is not a member of it, or the key is another organisation's; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

The audit log oldest first, as JSON Lines or CSV, at most 1000 events an export. The Plotwork-Next-Cursor header is where the next export starts (send it as after), and Plotwork-More says whether more are waiting. Enterprise only; the owner, admins, or an organisation key with audit:read.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `actor` | `string` | no | An actor's account or key id, or their address or key name, matched whole and without regard to case. |
| `action` | `string` | no | An action, or a group of them by its first two parts. |
| `target` | `string` | no | A target's id, or its name, matched whole and without regard to case. |
| `from` | `string` | no | From this time on (inclusive). |
| `to` | `string` | no | Before this time (exclusive). |
| `format` | `"csv" \| "jsonl"` | no | CSV with a header row, or JSON Lines (one event per line, the shape of `plotwork.audit-event.json`). |
| `after` | `string` | no | The `Plotwork-Next-Cursor` header of the export before, so a poller takes each event once. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The events, streamed. | none |
| 400 | A filter or the cursor is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | Not signed in, or the key is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | A member or a reader, or a key without `audit:read` (orgs.forbidden), or a plan without export (plan.audit_not_included). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation, the caller is not a member of it, or the key is another organisation's. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
