> ## 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 Company Export

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

## Overview

This endpoint retrieves the current status of a company export job created with the [Create Company Export](https://docs.cometly.com/api-reference/endpoint/create-company-export.md) 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

**id** `integer` *required*

The export ID returned from the [Create Company Export](https://docs.cometly.com/api-reference/endpoint/create-company-export.md) endpoint.

Example: `123`

## Response

### Export Status Fields

**export\_id** `string`

The unique identifier for this export job

**status** `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

**created\_at** `string`

ISO 8601 timestamp when the export was created

**message** `string`

User-friendly status message (present when status is `queued`, `processing`, or `failed`)

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

**download\_url** `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).

**completed\_at** `string`

ISO 8601 timestamp when the export finished processing

**expires\_at** `string`

ISO 8601 timestamp when the download URL will expire (15 minutes from request time)

## Example Requests

```bash cURL theme={null}
# Check export status
curl -G "https://app.cometly.com/public-api/v1/companies/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/companies/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
$exportId = 123;
$baseUrl = "https://app.cometly.com/public-api/v1/companies/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

export_id = 123
base_url = f'https://app.cometly.com/public-api/v1/companies/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']}")
```

## 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."
}
```

### 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](https://docs.cometly.com/introduction/rate-limiting.md) |

## Notes

* **Rate Limit**: This endpoint has a limit of **30 requests per minute** per Space. See [Rate Limiting](https://docs.cometly.com/introduction/rate-limiting.md) 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 may take longer.

## See Also

* [Create Company Export](https://docs.cometly.com/api-reference/endpoint/create-company-export.md) - Create a new export job
* [List Companies](https://docs.cometly.com/api-reference/endpoint/list-companies.md) - Alternative for smaller datasets


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.