Usage
Export usage data for billing
Export usage data for all tenants in a format suitable for billing systems.
Use cases:
- Import into billing systems (Stripe, Chargebee, etc.)
- Generate invoices
- Archive usage data
Export formats:
- csv - Comma-separated values (default)
- jsonl - JSON Lines (one JSON object per line)
- json - JSON array
Response headers:
- X-Total-Tenants - Total number of tenants in export
- X-Total-Sent - Total emails sent across all tenants
- Content-Disposition - Suggested filename for download
This endpoint returns up to 10,000 tenants per request. For organizations with more tenants, use the /usage/by-tenant endpoint with pagination.
get/usage/export
Query parameters
periodstring
Time period for export. Defaults to current month.
format'csv' | 'jsonl' | 'json'
Export format
status'active' | 'suspended' | 'archived'
Filter by tenant status
min_sentinteger
Only include tenants with at least this many emails sent
timezonestring
Timezone for period calculations (IANA format). Defaults to UTC.
Response
Usage export data
Example response
[
{
"tenant_id": "cm6abc123def456",
"tenant_name": "Acme Corp",
"external_id": "acme_123",
"status": "active",
"sent": 10000,
"delivered": 9700,
"soft_failed": 100,
"hard_failed": 50,
"bounced": 100,
"held": 50,
"delivery_rate": 0.97,
"bounce_rate": 0.015
}
]