Data Export
Export platform data in CSV or JSON format.
The data export API lets you create export jobs for platform data. Exports run asynchronously — you create a job, then poll for completion and download the result.
Scope: exports:create
Rate limit: 1,000/hr
Create an export job
POST /api/v1/exports
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Data type to export (see below) |
format | string | Yes | csv or json |
filters | object | No | Optional filters (date range, status, etc.) |
Exportable data types
| Type | Description |
|---|---|
email_logs | Email delivery history |
permission_audit | Permission decision audit logs |
permission_changes | Permission mutation logs |
usage_metrics | Usage data by service |
invoices | Billing invoices |
curl -X POST https://api.platformxe.com/api/v1/exports \
-H "Content-Type: application/json" \
-H "x-api-key: pxk_live_your_api_key_here" \
-d '{
"type": "email_logs",
"format": "csv",
"filters": {
"from": "2026-03-01T00:00:00Z",
"to": "2026-04-01T00:00:00Z"
}
}'
const job = await px.createExport({
type: 'email_logs',
format: 'csv',
filters: {
from: '2026-03-01T00:00:00Z',
to: '2026-04-01T00:00:00Z',
},
});
console.log(job.data.id); // "exp_abc123"
console.log(job.data.status); // "processing"
Check export status
GET /api/v1/exports/:id
curl https://api.platformxe.com/api/v1/exports/exp_abc123 \
-H "x-api-key: pxk_live_your_api_key_here"
Response
{
"success": true,
"data": {
"id": "exp_abc123",
"type": "email_logs",
"format": "csv",
"status": "completed",
"downloadUrl": "https://storage.platformxe.com/exports/exp_abc123.csv",
"expiresAt": "2026-04-06T14:30:00.000Z",
"rowCount": 4250
}
}
| Status | Description |
|---|---|
processing | Export job is running |
completed | Ready to download |
failed | Export encountered an error |
Download URLs expire after 24 hours. Retrieve the export file before the expiry time or create a new export job.
Error responses
| Code | Description |
|---|---|
BAD_REQUEST | Invalid export type or format |
FORBIDDEN | API key missing exports:create scope |
NOT_FOUND | Export job does not exist |