# POST /exports/templates/:id/run

**Resource:** [Export Templates](./export-templates.md)  
**Scopes:** `exports:read`  
**Write operation:** no

Run an export template and download the resulting XLSX or CSV file. Up to 250,000 rows are exported (X-Truncated: 1 header if the cap is hit). Optionally apply a saved view's filter/sort overrides. Supports all filter operators: tags use in (OR/"has any of") / not_in (NOR/"has none of"); not_contains is a back-compat alias for not_in.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Template ID. |
| `view_id` | body | uuid | no | Apply a saved view's filter/sort overrides before running. |

## Response example

```json
{
  "request": "curl -X POST \\\n  -H \"Authorization: Bearer tp_live_...\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}' \\\n  \"https://api.trustpager.com/functions/v1/api/v1/exports/templates/3fa85f64-5717-4562-b3fc-2c963f66afa6/run\" \\\n  --output export.xlsx",
  "response": "# Binary XLSX (or CSV) file download.\n# Response headers:\n# Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n# Content-Disposition: attachment; filename=\"Tagged PET leads - not VIP-2026-05-19.xlsx\"\n# X-Row-Count: 87\n# X-Truncated: 0"
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`