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

# Export Widget Leads (CSV)

> Download all leads captured by a widget as CSV.

Returns a CSV attachment. Columns are the union of all captured lead fields, plus `country`, `referrer`, and `date`.

## Authentication

Requires a Bearer token (API key) or a dashboard session.

## Path Parameters

<ParamField path="id" type="string" required>
  The widget config UUID.
</ParamField>

## Query Parameters

<ParamField query="from" type="string">
  ISO timestamp lower bound (inclusive).
</ParamField>

<ParamField query="to" type="string">
  ISO timestamp upper bound (inclusive).
</ParamField>

## Example

```bash curl theme={null}
curl -L "https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/leads/export" \
  -H "Authorization: Bearer $THEO_API_KEY" \
  -o widget-leads.csv
```
