# company.export

Export all of the company's data as one ZIP: manifest.json, data/<table>.json with every row the company has in every table, files/<bucket>/<path> with its stored files (receipts, emails, statements, agreements, invoices) and a README. Secret values (encrypted credentials and bank or tax details, sealed keys, one-time codes, private link tokens) are replaced with "[redacted]" and listed in redactedColumns. One download holds at most 50 MB: the records come first and files fill the rest; files that don't fit are listed with included false, and company.export.files gives a link for each. includeFiles false leaves files out (default true). Returns a link valid for 5 minutes, the counts of tables, rows and files, and how many files were skipped. Administrators only.

`POST /api/v1/accounting/company.export`

Permissions: `accounting:read`, `accounting:admin` · Roles: admin

MCP tool: `accounting_company_export`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `includeFiles` | boolean |  | Also include files. Default `true`. |
| `idempotencyKey` | string |  | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/company.export \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{}'
```

Reference page: https://app.getoatmilk.com/docs/api/company.export
