> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# Export an audit log file for a Benchling object

POST https://{tenant_name}.benchling.com/api/v2/audit/log/{object_id}
Content-Type: application/json

This endpoint launches a [long-running task](#/Tasks/getTask) and returns the Task ID of the launched task. The `ExportAuditLogAsyncTask` response contains a link to download the exported audit log file from Amazon S3. This endpoint is subject to a rate limit of 500 requests per hour, in conjunction with the global request rate limit. Export throughput will additionally be rate limited around the scale of 70,000 total audit events exported in csv format or 30,000 total audit events exported in pdf format per hour.


Reference: https://docs.benchling.com/docs/api/v2/benchling-api/audit/log

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `object_id` (string, required)

### Body (application/json)

This endpoint expects an AuditLogExport.

- `format` (enum, required) — The format of the exported file.
  - Allowed values: `CSV`, `PDF`

## Response

### 202

Accepted

- `taskId` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

## Types

### BadRequestErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

## Examples

**Request**

```json
{
  "format": "CSV"
}
```

**Response**

```json
{
  "taskId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/audit/log/seq_yWs5X7lv"

payload = { "format": "CSV" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v2/audit/log/seq_yWs5X7lv';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"format":"CSV"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```