# Get the status of an export

Source: https://docs.emelia.io/docs/lists/get-status-of-export

Guide: [Lists & contacts](https://docs.emelia.io/docs/lists.md)

`GET https://api.emelia.io/lists/list/export/jobs/{jobId}`

Returns the progress of an asynchronous export started with `POST /lists/list/export` and `async: true`. Poll every few seconds until `status` is `done` (then call the download route) or `failed` (read `error`). Jobs are kept 24 hours; after that, or for a job of another account, the route returns 404. A job interrupted by a service restart ends as `failed`: start the export again.

## Authentication

Send your API key in the `Authorization` header: `Authorization: <your API key>`.

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `jobId` | string (uuid) | yes | Job id returned by the export request (UUID). |

## Example request

**cURL**

```bash
curl -X GET "https://api.emelia.io/lists/list/export/jobs/0b6f3c1e-8a2d-4c5b-9e7f-1a2b3c4d5e6f" \
  -H "Authorization: $EMELIA_API_KEY"
```

**JavaScript**

```js
const response = await fetch('https://api.emelia.io/lists/list/export/jobs/0b6f3c1e-8a2d-4c5b-9e7f-1a2b3c4d5e6f', {
  method: 'GET',
  headers: { Authorization: process.env.EMELIA_API_KEY },
});
console.log(await response.json());
```

**Python**

```python
import os
import requests

response = requests.get(
    "https://api.emelia.io/lists/list/export/jobs/0b6f3c1e-8a2d-4c5b-9e7f-1a2b3c4d5e6f",
    headers={"Authorization": os.environ["EMELIA_API_KEY"]},
)
print(response.json())
```

## Responses

### 200: Job state.

| Field | Type | Required | Description |
|---|---|---|---|
| `jobId` | string (uuid) | yes |  |
| `status` | enum: `queued`, `running`, `done`, `failed` | yes |  |
| `rows` | integer | yes | Rows written so far. |
| `total` | integer or null | yes | Rows to write, null until counted. |
| `filename` | string or null | yes | File name, set when done. |
| `error` | string or null | yes | Failure reason when `status` is `failed`. |

```json
{
  "jobId": "string",
  "status": "queued",
  "rows": 0,
  "total": 0,
  "filename": "string",
  "error": "string"
}
```

### 401: Missing, unknown or disabled API key, or the account of the key no longer exists. Note the body shape: `error` and `code`, not `message`.

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | string | yes |  |
| `code` | enum: `AUTH_REQUIRED`, `ACCOUNT_NOT_FOUND` | yes |  |

```json
{
  "error": "string",
  "code": "AUTH_REQUIRED"
}
```

### 404: Unknown, expired or foreign job.

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | yes | English, human-readable message. |
| `code` | string | no | Stable error code, when available (for example `PAYLOAD_TOO_LARGE`, `INVALID_JSON`, `export_too_large`, `companies_only`, `enrichment_running`). |
| `params` | object | no |  |
| `error` | string | no | Raw internal message (unexpected errors only). |

```json
{
  "message": "Export job not found"
}
```

### 500: Unexpected server error. `error`, when present, is a raw internal message: do not parse it. Retry later.

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | yes | English, human-readable message. |
| `code` | string | no | Stable error code, when available (for example `PAYLOAD_TOO_LARGE`, `INVALID_JSON`, `export_too_large`, `companies_only`, `enrichment_running`). |
| `params` | object | no |  |
| `error` | string | no | Raw internal message (unexpected errors only). |

```json
{
  "message": "Hmm... Something went wrong. Please try again later."
}
```
