Export messages, delivery results, events, opt-outs, webhook deliveries, usage, credit history or the audit log as CSV

Streams a CSV (UTF-8 with BOM).

GET/v1/exports/{kind}

Path Parameters

  • kindmessages, deliveries, events, opt_outs, webhook_deliveries, usage, usage_monthly, audit_log, credit_historyrequired

Query Parameters

  • fromstring

    ISO date/time or epoch ms (messages, deliveries, events, webhook_deliveries) Example: 2026-01-01.

  • tostring

    Inclusive; a bare date means the end of that day (UTC) Example: 2026-01-31.

  • statusqueued, sent, delivered, failed, blocked, received

    messages, deliveries

  • blocked_reasonstring

    messages, deliveries: blocked messages with this reason

  • directionoutbound, inbound

    messages

  • numberstring

    messages, deliveries: digits matched against either side

  • to_numberstring

    messages, deliveries: exact recipient (E.164). to/from are the date range here.

  • from_numberstring

    messages, deliveries: exact sender (E.164)

  • customer_idstring

    messages, deliveries

  • failure_codecarrier_filtered, unreachable, invalid_number, opted_out, campaign_mismatch, content_blocked, screen_unavailable, rate_limited, landline, carrier_rejected, spend_limit_reached, insufficient_credits, sender_not_registered, quiet_hours, consent_required, reconfirmation_pending, reconfirmation_expired, held_for_review, review_rejected, review_expired, campaign_paused, sender_rotation, recipient_not_verified, quota_exceeded, destination_not_allowed, account_closed, account_suspended, account_paused, topic_unsubscribed, unknown

    messages, deliveries: failed for this reason (the failure.code on a message)

  • batchstring

    messages, deliveries: batch id (bc_...)

  • qstring

    messages: body/failure text; events: id/payload text

  • typestring

    events, webhook_deliveries Example: message.failed.

  • endpoint_idstring

    webhook_deliveries (default: all endpoints)

  • okboolean

    webhook_deliveries

  • monthsinteger

    usage: daily rows for the last N months Default 3. Maximum 12. Minimum 1.

  • actionstring

    audit_log: one action, or a group prefix with a trailing dot (team.)

  • actorstring

    audit_log: actor id or part of the actor email

  • target_typestring

    audit_log

  • created_afterstring

    audit_log: same as on GET /audit-logs (from is accepted too)

  • created_beforestring

    audit_log: same as on GET /audit-logs (to is accepted too)

Details

At most 50,000 rows per export (header X-Export-Row-Cap); narrow the date range if you hit it. Cells that would be spreadsheet formulas are prefixed with a single quote.

Responses

  • 200text/csv

    CSV body

  • 400Error

    Unknown kind or invalid filter

  • 401Error

    Missing, malformed, or revoked API key

  • 402Error

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429Error

    Rate limit or quota exceeded

Errors

Every error has the same JSON shape, and request_id matches the X-Request-Id response header. Errors lists every code and what to do about it.

  • 400

    Unknown kind or invalid filter

  • 401

    Missing, malformed, or revoked API key

  • 402

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429

    Rate limit or quota exceeded