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

# Get Event Export

> Check the status of an export job and retrieve the download URL when ready

## Overview

This endpoint retrieves the current status of an export job created with the [Create Event Export](/api-reference/endpoint/create-event-export) endpoint. Once the export is complete, it provides a presigned download URL for the exported file.

Poll this endpoint regularly to check when your export is ready for download.

## Path Parameters

<ParamField path="id" type="integer" required>
  The export ID returned from the [Create Event Export](/api-reference/endpoint/create-event-export) endpoint.

  Example: `123`
</ParamField>

## Response

### Export Status Fields

<ResponseField name="export_id" type="integer">
  The unique identifier for this export job
</ResponseField>

<ResponseField name="status" type="string">
  Current status of the export job

  Possible values:

  * `queued` - Export job is waiting to be processed
  * `processing` - Export is currently being generated
  * `completed` - Export is complete and ready for download
  * `failed` - Export failed
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when the export was created
</ResponseField>

<ResponseField name="message" type="string">
  User-friendly status message (present when status is `queued`, `processing`, or `failed`)
</ResponseField>

### Additional Fields (When Status = `completed`)

<ResponseField name="download_url" type="string">
  Presigned S3 URL to download the export file. This URL expires after 15 minutes for security.

  The file is in **gzipped NDJSON** format (Newline-Delimited JSON, compressed with gzip).
</ResponseField>

<ResponseField name="completed_at" type="string">
  ISO 8601 timestamp when the export finished processing
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO 8601 timestamp when the download URL will expire (15 minutes from request time)
</ResponseField>

## Example Requests

<CodeGroup>
  ```bash cURL theme={null}
  # Check export status
  curl -G "https://app.cometly.com/public-api/v1/events/exports/123" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```javascript JavaScript theme={null}
  // Check export status
  const exportId = 123;

  const response = await fetch(`https://app.cometly.com/public-api/v1/events/exports/${exportId}`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Accept': 'application/json'
    }
  });

  const exportData = await response.json();
  console.log(`Status: ${exportData.status}`);

  if (exportData.status === 'completed') {
    console.log(`Download URL: ${exportData.download_url}`);
    console.log(`Expires at: ${exportData.expires_at}`);
  }
  ```

  ```php PHP theme={null}
  <?php
  // Check export status
  $exportId = 123;
  $baseUrl = "https://app.cometly.com/public-api/v1/events/exports/{$exportId}";
  $headers = [
      'Authorization: Bearer YOUR_API_KEY',
      'Accept: application/json'
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $baseUrl);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  $response = curl_exec($ch);
  $exportData = json_decode($response, true);
  curl_close($ch);

  echo "Status: {$exportData['status']}\n";

  if ($exportData['status'] === 'completed') {
      echo "Download URL: {$exportData['download_url']}\n";
      echo "Expires at: {$exportData['expires_at']}\n";
  }
  ?>
  ```

  ```python Python theme={null}
  import requests

  # Check export status
  export_id = 123
  base_url = f'https://app.cometly.com/public-api/v1/events/exports/{export_id}'
  headers = {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Accept': 'application/json'
  }

  response = requests.get(base_url, headers=headers)
  export_data = response.json()

  print(f"Status: {export_data['status']}")

  if export_data['status'] == 'completed':
      print(f"Download URL: {export_data['download_url']}")
      print(f"Expires at: {export_data['expires_at']}")
  ```
</CodeGroup>

## Example Responses

### Queued Export

```json theme={null}
{
  "export_id": 123,
  "status": "queued",
  "created_at": "2024-01-15T10:30:00Z",
  "message": "Export is being processed. Please check back in a few minutes."
}
```

### Processing Export

```json theme={null}
{
  "export_id": 123,
  "status": "processing",
  "created_at": "2024-01-15T10:30:00Z",
  "message": "Export is being processed. Please check back in a few minutes."
}
```

### Completed Export

```json theme={null}
{
  "export_id": 123,
  "status": "completed",
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:33:42Z",
  "download_url": "https://bucket.s3.amazonaws.com/exports/a3f2c8d9-1234-5678-9abc-def012345678.json.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
  "expires_at": "2024-01-15T10:48:42Z"
}
```

### Failed Export

```json theme={null}
{
  "export_id": 123,
  "status": "failed",
  "created_at": "2024-01-15T10:30:00Z",
  "message": "Export failed. Please try again in a few minutes. If the problem persists, contact support."
}
```

## Status Codes

| Status Code | Description                                                                               |
| ----------- | ----------------------------------------------------------------------------------------- |
| 200         | Export status retrieved successfully                                                      |
| 401         | Missing or invalid API key                                                                |
| 403         | API key doesn't have permission or subscription is inactive                               |
| 404         | Export not found or belongs to a different space                                          |
| 429         | Too many requests - rate limit exceeded. See [Rate Limiting](/introduction/rate-limiting) |

## Notes

* **Rate Limit**: This endpoint has a limit of **30 requests per minute** per Space. See [Rate Limiting](/introduction/rate-limiting) for details.
* **Download URL Expiration**: The presigned download URL expires **15 minutes** after you retrieve it. If it expires, make another GET request to this endpoint to get a fresh URL.
* **Space Isolation**: You can only access exports created by your space. Attempting to access another space's export returns 404.
* **File Security**: Export files use UUID-based filenames to prevent enumeration. Download URLs are cryptographically signed and time-limited.
* **Processing Time**: Exports typically complete within seconds to a few minutes. Large exports (100,000+ events) may take longer.
* **Retry Logic**: If an export fails, create a new export job rather than retrying the same one.
* **Storage**: Export files are stored for retrieval but should be downloaded promptly. Don't rely on long-term storage of export files in Cometly's system.

## See Also

* [Create Event Export](/api-reference/endpoint/create-event-export) - Create a new export job
* [Exports vs Pagination](/concepts/exports-vs-pagination) - Understand when to use exports
* [List Events](/api-reference/endpoint/list-events) - Alternative for smaller datasets
