# Export the workspace's whole audit log as a file

> Export the workspace's whole audit log as a file: CustomDomain™ API reference. Covers request parameters, the request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/enterprise/exportAudit

## `GET https://api.customdomain.ai/v1/audit/export`

Every event of the caller's workspace, newest first, as CSV (the default) or JSON lines. The row count equals `X-Audit-Total`. Needs an API key held by an owner or admin; any other caller is refused with `403`. The route answers `404` until it is switched on for the workspace.

### Authentication

`apiKey`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `format` | query | `csv`, `json` | no | `csv`, or `json` for one JSON object per line. |

### Responses

| Status | Description |
| --- | --- |
| `200` | The log as a file |
| `400` | Error envelope: {code, title, details, request_id}. |
| `401` | Error envelope: {code, title, details, request_id}. |
| `403` | Error envelope: {code, title, details, request_id}. |
| `404` | Error envelope: {code, title, details, request_id}. |
| `503` | Error envelope: {code, title, details, request_id}. |

The full specification is served at `GET https://api.customdomain.ai/v1/openapi.json`.
