> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexrex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Exports

> Run asynchronous data exports and download the results.

Exports let you pull a bundle of your organization's activity data — as CSV,
JSON, or both — for analysis, reporting, or migration. Exports run
**asynchronously**: you create a job, poll until it's ready, then download a
signed file.

## The flow

<Steps>
  <Step title="Create a job">
    `POST /exports` with `exports:create`. Returns `202 Accepted` and a job in
    `pending` status.

    ```bash theme={null}
    curl -X POST https://api.nexrex.ai/api/v1/developer/v1/exports \
      -H "Authorization: Bearer nrx_prod_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "format": "both",
        "start_date": 1748736000000,
        "end_date": 1751328000000
      }'
    ```
  </Step>

  <Step title="Poll for completion">
    `GET /exports/{export_id}` with `exports:read`. The `status` moves from
    `pending` → `running` → `completed` (or `failed`). Poll every few seconds.
  </Step>

  <Step title="Download">
    Once `completed`, `GET /exports/{export_id}/download` returns a **short-lived
    signed URL** and the seconds until it expires:

    ```json theme={null}
    {
      "success": true,
      "data": {
        "download_url": "https://storage.googleapis.com/…",
        "expires_in_seconds": 600
      }
    }
    ```

    Fetch the `download_url` promptly — it's valid for about 10 minutes. You can
    request a fresh one any time while the export exists.
  </Step>
</Steps>

## Request options

| Field         | Default      | Meaning                                                      |
| ------------- | ------------ | ------------------------------------------------------------ |
| `format`      | `both`       | `csv`, `json`, or `both`                                     |
| `start_date`  | all time     | Start of range, **epoch milliseconds (UTC)**                 |
| `end_date`    | all time     | End of range, **epoch milliseconds (UTC)**                   |
| `athlete_ids` | all athletes | Restrict to specific org athletes; omit for the whole roster |

## Job lifecycle and retention

* Statuses are `pending`, `running`, `completed`, `failed`, and `deleted`.
* Completed exports are retained for **7 days**, then deleted automatically. The
  `expires_at` field tells you when. After that, create a new export.
* A key sees only exports **it created within its own organization** — exports
  made in the web console or by other keys are not visible.

## Athletes who can't be included are skipped, not fatal

An export never fails because one athlete can't be included. Athletes who have
left the organization (or otherwise can't be accessed) are **skipped and listed**
in the job's `skipped_athletes` array, each with a `uid` and a `reason`, and are
also recorded in the export's manifest. The rest of the export completes normally.

## Athletes are notified

When an export includes an athlete's data, that athlete receives an in-app
**transparency notification** telling them their organization exported training
data that includes their activities, and pointing them to the organization's
audit log. Every export is also written to the org audit log with the key that
created it. This is core to the [Data Portability
Promise](https://nexrex.ai/data-portability): data moves, but never silently.

<Note>
  Rate limits: `POST /exports` is additionally capped at **5 requests/hour** per
  key, on top of the standard per-key limits. See
  [Rate limits](/api-reference/rate-limits).
</Note>
