> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mithunai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export the audit log as CSV or JSON Lines

> Download your organization audit events in a date range, oldest first, as CSV or JSON Lines, filtered by actor, action or category. Owner or admin only.

Your organization's audit events in a range, oldest first, as a file download. Requires the owner or admin role. The response never holds another organization's events, whatever you ask for, and every export is itself recorded in the log as `audit_log.export`. See [Audit log](https://docs.mithunai.com/administration/audit-log.md) for the fields.

The body is streamed. One export holds at most 100,000 events; export a busier period in shorter ranges.

**format** `string` (default: csv)

`csv`, with a header row, or `jsonl`, one JSON object per line. Anything else returns `400`.

**from** `string`

Start, inclusive: an ISO 8601 date or date-time, UTC when no offset is given. Defaults to 30 days
before `to`.

**to** `string`

End, exclusive: an ISO 8601 date or date-time. A bare date includes that whole day. Defaults to
now. The range covers at most 366 days.

**actor** `string`

One actor: an account id, or a subject such as an API key id.

**action** `string`

One exact action, such as `assistant.update`.

**category** `string`

Every action on one kind of resource, such as `assistant` for `assistant.*`.

## Response

`200` with `Content-Type: text/csv` or `application/x-ndjson` and
`Content-Disposition: attachment`. In CSV, `metadata` is one JSON-encoded cell, and a cell that
would start a spreadsheet formula begins with `'`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.