Skip to main content

Data Exports

Export email logs, metrics, and analytics data from Motorical.

Quick Preview

Get a lightweight preview of recent logs without creating a background job:

curl -H "Authorization: Bearer $TOKEN" \
"$BASE_URL/motor-blocks/$BLOCK_ID/exports/preview?limit=100"

Parameters:

ParameterDescription
limitMax records (default 100, max 500)
includePIItrue/false (requires logs.pii scope)

Background Export Jobs

For larger exports, create a background job that generates an NDJSON download:

Create an Export Job

curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"jobType":"logs"}' \
"$BASE_URL/motor-blocks/$BLOCK_ID/exports"

Returns 202 Accepted with the job id and status: "queued".

List Export Jobs

curl -H "Authorization: Bearer $TOKEN" \
"$BASE_URL/motor-blocks/$BLOCK_ID/exports"

Returns the 50 most recent export jobs with id, status, job_type, and created_at.

Check Job Status

curl -H "Authorization: Bearer $TOKEN" \
"$BASE_URL/exports/$JOB_ID"

When the job is complete, the response includes a download_url with a short-lived (15-minute) download token.

Download Export

curl -o export.ndjson \
"$BASE_URL/exports/$JOB_ID/download?token=$DOWNLOAD_TOKEN"

Downloads the completed export as an NDJSON file. The download token is single-use and expires after 15 minutes.

Export Formats

FormatUse Case
NDJSONMachine-readable, streaming-friendly
CSVAvailable for Communications Block contact exports
JSONGDPR data portability exports

Communications Block Exports

Contact List Export

Download complete contact lists:

GET /comm-api/api/lists/{id}/contacts/export
X-Tenant-Id: your-tenant-uuid

GDPR Data Export

Comprehensive per-contact data export including profile, campaign history, tracking events, and suppression status. Delivered via email as JSON and CSV attachments.

Best Practices

  • Use preview exports for quick debugging
  • Schedule background exports for large datasets
  • Store exports securely — they may contain PII
  • Set appropriate includePII flags based on your compliance needs
  • Monitor export job status via the API