# Exports API

Every exports call: what to send, what comes back, and copy-ready examples.

## Start an export

`POST /exports` (scope: reports:read or content:read or sales:read or people:read or links:read)

```bash
curl -X POST "https://api.usetotems.com/v1/exports" \
  -H "Authorization: Bearer $TOTEMS_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "sales",
    "from": "2026-11-01",
    "to": "2026-11-30"
  }'
```

```json
{
  "data": {
    "id": "2aac706b-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "kind": "sales",
    "state": "queued",
    "created_at": "2026-12-03T23:43:28.323Z"
  },
  "request_id": "req_..."
}
```

## Status and a short-lived file

`GET /exports/{id}` (scope: reports:read or content:read or sales:read or people:read or links:read)

```bash
curl "https://api.usetotems.com/v1/exports/6f1d2c9a-3b47-4c0e-9a55-1f2e3d4c5b6a" \
  -H "Authorization: Bearer $TOTEMS_KEY"
```

```json
{
  "data": {
    "id": "2aac706b-7c15-4e2b-8d44-5b6a7c8d9e0f",
    "kind": "sales",
    "state": "running",
    "file_url": null
  },
  "request_id": "req_..."
}
```
