Create an async CSV import job
Accepts multipart/form-data with a file field (the CSV) and an
optional block_ttl_days (integer >0, default 30). Validates:
- content ≤ 25 MiB, else
413 - row count ≤ 250 000, else
413 - header-only / all-blank / undetectable provider →
400Returns202with the import record (statuspending); an Oban worker (EmailBlockImportWorker, max_attempts 3) transitionspending → processing → completed | failed.
Native Telnyx exports are detected by the stable first-12-column
header signature (id … group_id) and are restored with their
original from, domain_id, group_id, source, status,
expires_at, plus bounce_category, dsn_code, and meta when
present (scope is re-derived from domain_id/from; the
exported scope cell must be a valid enum value). Lifecycle
changes reconcile through the same create path as the API: a row
already in the requested state restores its mutable backup fields
without a new audit event, and a real transition (e.g. tombstone
→ active) appends the matching lifecycle event. block_ttl_days
is not applied to native rows — their exported expires_at is
preserved verbatim.
Competitor and generic imports (SendGrid / Mailgun / SES /
generic) remain account-scoped (from, domain_id, group_id,
scope are not read) and block_ttl_days applies only to
imported manual_block rows; other reasons get expires_at: nil.
Provider is auto-detected from the CSV header
(sendgrid / mailgun / ses / generic).
Authorizations
Telnyx API key supplied as Authorization: Bearer <token>. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.
Body
Response
Import job accepted (status pending).
Import job. Schema fields hidden: account_id, csv_content,
block_ttl_days. Nullable fields use the omit-nullable pattern.