---
title: "Collect a logs export"
url: https://docs.corefinity.com/api/reference/logs/collect-logs-export
type: endpoint
last_updated: 2026-11-13
feature: logs
related:
  - https://docs.corefinity.com/guides/sites/logs-and-monitoring/logs.md
---
# Collect a logs export

Answers the file of a ready export, once: CSV or one JSON object a line, not a JSON document. Send the
`capability` the start answered; once the file has been collected, or after 24 hours, the answer is `410`.

```http
POST /api/corestack/logs/exports/{download}/collect
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 5 every 10 minutes
- Try it in the console: off. It deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

## Path parameters

- `download` (string, required): The `id` of an export, as its start answered it. 26 characters.

## Body

- `capability` (string, required): The `capability` the export's start answered.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "capability": "Example-export-capability-0000000000000000000001"
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect', [
        'capability' => 'Example-export-capability-0000000000000000000001',
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    capability: 'Example-export-capability-0000000000000000000001',
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "capability": "Example-export-capability-0000000000000000000001",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The file. It can be collected once.

```json
"string"
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The export is still being prepared (`download_preparing`). Nothing is used up; try again when its `state` is `ready`.

```json
{
  "code": "download_preparing",
  "message": "The download is still being prepared.",
  "reason": "download_preparing"
}
```

### 410 The export has been collected already, has expired or failed (`expired`). Start a new one.

```json
{
  "code": "expired",
  "message": "This download has expired. Prepare it again.",
  "reason": "expired"
}
```

### 422 The `capability` is missing or is not this export's. Nothing is used up.

```json
{
  "code": "invalid",
  "errors": {
    "capability": [
      "This download link is not valid."
    ]
  },
  "field": "capability",
  "message": "This download link is not valid.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `download_preparing` | The download is still being prepared. |
| 410 | `expired` | The link, recording or transfer has expired. Start again. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Logs](https://docs.corefinity.com/guides/sites/logs-and-monitoring/logs.md)
