Data Export API
Download raw events and reporting summaries as CSV or ZIP files with a workspace API key.
Last updated August 28, 2026
Use the Data Export API for scheduled backups, spreadsheet imports, and external reporting. The API returns one selected category as CSV or multiple categories as a ZIP containing one CSV per category. Create a key in Settings > API Keys and send it as a bearer token.
POST /api/v1/export
1curl https://usegrometrics.com/api/v1/export \2-H "Authorization: Bearer YOUR_API_KEY" \3-H "Content-Type: application/json" \4--output grometrics-export.zip \5-d '{6"categories": ["events", "analytics", "revenue"],7"range": "30d",8"platform": "both"9}'
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| categories | string array | ✓ | One or more export categories: events, analytics, attribution, revenue, transactions, visitors, sources, campaigns, pages, geography, devices, goals, or funnels |
| range | string | no | Relative range: 7d, 30d, 90d, or all. Omit it when using startAt and endAt |
| startAt | ISO date string | no | Custom range start; endAt is required when this is present |
| endAt | ISO date string | no | Custom range end; startAt is required when this is present |
| platform | string | ✓ | Export scope: website, mobile, or both |
Empty exports
A successful export with no matching rows still contains the canonical CSV headers and returns X-Grometrics-Empty-Export: true.
What happens next
Store the downloaded file securely. Raw event and transaction exports can contain identifiers and customer context from the selected workspace.
Troubleshooting
Request is unauthorized
Check that the Authorization header uses a valid, unrevoked API key from the workspace you want to export.
The response is CSV instead of ZIP
Selecting one applicable category returns CSV. Select two or more applicable categories to receive a ZIP.
Was this page helpful?