# Create export

Starts a background export of payments or ledger entries as CSV or PDF, with optional filters and grouping; poll it until ready. Requires export:create. The file can be downloaded for 24 hours.

`POST /v1/exports`

Starts a background export of payments or ledger entries as CSV or PDF, with optional filters and grouping; poll it until ready. Requires export:create. The file can be downloaded for 24 hours.

Requires permission `export:create`.

## Request body

```json
{
  "filters": {},
  "include_simulated": true,
  "format": "string",
  "kind": "string",
  "group_by": "string"
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.

Example 200 response:

```json
{
  "export": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "org_id": "org_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "status": "active",
    "row_count": 1,
    "filters": {},
    "format": "string",
    "kind": "string",
    "group_by": "string",
    "filename": "string",
    "include_simulated": true,
    "created_by": "string",
    "expires_at": "2026-11-16T12:00:00Z",
    "created_at": "2026-11-16T12:00:00Z",
    "download_url": "https://example.com/resource"
  }
}
```
