# Export Report CSV

> Download a report as CSV.

Requires an API key with the `read` scope.

Counts follow the Reports page: a bounced email counts as sent, replies are distinct leads, and replies from bounce, warmup and unrelated mail are left out. Days are bucketed in the timezone of the user who created the API key.

The file is streamed as it is built. The `activity` type has one row per event and stops at 100,000 rows.

## Query Parameters

<ParamField query="type" type="string">`summary`, `daily`, `campaigns`, `steps`, `accounts` or `activity`. Default `campaigns`.</ParamField>
<ParamField query="start" type="string">First day, `YYYY-MM-DD`. Defaults to 30 days before `end`.</ParamField>
<ParamField query="end" type="string">Last day, `YYYY-MM-DD`. Defaults to today in the key owner's timezone. A range is at most 365 days.</ParamField>
<ParamField query="campaignIds" type="string">Comma-separated campaign ids to include.</ParamField>
<ParamField query="accountIds" type="string">Comma-separated email account ids to include.</ParamField>

## Response

Returns `text/csv` with a `Content-Disposition` filename such as `foxreach-campaigns-2026-10-01-to-2026-10-31.csv`.

<RequestExample>
```bash cURL
curl "https://api.foxreach.io/api/v1/analytics/reports/export?type=daily" \
  -H "X-API-Key: otr_your_key" \
  -o daily.csv
```

```python Python SDK
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
csv_text = client.analytics.export_report(type="daily")
```

```typescript TypeScript SDK
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const csv = await client.analytics.exportReport({ type: "daily" });
```
</RequestExample>

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `read` |
| `400` | `start` is after `end`, or the range is longer than 365 days |
| `404` | A campaign or account id is not in this workspace |
| `422` | `type` is not one of the listed values |

## Rate Limit

- **100 requests per minute, shared by every `bulk` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`bulk`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns, see [Rate Limiting](/rate-limiting).
