---
title: "Create a batch of email messages"
method: POST
path: "/email_messages/batch"
tags: ["Email Messages"]
---

# Create a batch of email messages

`POST /email_messages/batch`

Creates up to 50 email messages in a single request.

## Headers

- `Idempotency-Key` string

## Request body

- CreateEmailBatchRequest
  - `messages` CreateEmailBatchItemRequest[], required
    - `attachments` AttachmentRequest[]
      - `content` string — Attachment content, typically Base64-encoded. Defaults to empty string when omitted.
      - `content_id` string, nullable — MIME Content-ID used to reference an inline attachment.
      - `content_type` string — MIME content type. Defaults to "application/octet-stream" when omitted.
      - `disposition` string — MIME disposition (`attachment` or `inline`).
      - `filename` string — Attachment filename. Defaults to "attachment" when omitted.
    - `bcc` EmailAddressInput[]
      - union
        - string
        - EmailAddress
          - `email` string, required
          - `name` string
    - `cc` EmailAddressInput[]
      - union
        - string
        - EmailAddress
          - `email` string, required
          - `name` string
    - `from` union, required
      - string
      - EmailAddress
        - `email` string, required
        - `name` string
    - `from_name` string — Optional display name for string `from`; overrides `from.name` when provided.
    - `group_id` string, uuid, nullable — Optional unsubscribe-group UUID used for group-scoped suppression checks and unsubscribe handling.
    - `headers` object — Custom email headers. Write-only; not returned in responses.
    - `html_body` string — HTML email body. Returned only by `GET /email_messages/{id}`; omitted from create and list responses.
    - `ignore_suppression` boolean — When true, allows delivery to recipients whose suppressions explicitly permit an override. Hard bounces, spam complaints, and invalid-address suppressions cannot be overridden. Requires the `email:override` API scope.
    - `inline_css` boolean
    - `metadata` object — Custom metadata. Write-only; not returned in responses.
    - `reply_to` union
      - string
      - EmailAddress
        - `email` string, required
        - `name` string
    - `sandbox_mode` boolean
    - `scheduled_at` string, date-time, nullable — Future ISO 8601 time to schedule sending. Invalid or past timestamps are silently ignored and the email is sent immediately. The legacy alias `send_at` is still accepted for backward compatibility; when both are provided, `scheduled_at` wins.
    - `send_at` string, date-time — Deprecated alias for `scheduled_at`.
    - `subject` string — Required unless `template_id` is supplied. When using a template, the template's subject is rendered; if the template has no subject or renders empty, the request returns 400.
    - `tags` string[] — Tags for categorization and reporting. Stored on the message and propagated to Email Detail Records. Not returned in API responses.
    - `template_id` string, uuid
    - `template_variables` object — Variables for Liquid template rendering. Non-object values may cause a 422 validation error on message creation, but are silently treated as an empty object for template rendering.
    - `text_body` string — Plain text email body. Returned only by `GET /email_messages/{id}`; omitted from create and list responses.
    - `to` EmailAddressInput[], required
      - union
        - string
        - EmailAddress
          - `email` string, required
          - `name` string
    - `tracking_settings` TrackingSettings — Per-send open and click tracking overrides. Omitted properties inherit the sender domain's tracking settings.
      - `click_tracking` boolean — Whether to rewrite links for click tracking in this message.
      - `open_tracking` boolean — Whether to inject an open-tracking pixel for this message.
  - `sandbox_mode` boolean — Applies sandbox mode to all messages in the batch. Overrides any per-message sandbox_mode in the messages array.

## Response `207`

Multi-Status — all batch responses return 207. When all messages succeed, `errors` is empty and every item is in `data`. When one or more fail, the response contains a `data` array for successes and an `errors` array for failures.

- EmailBatchResponse
  - `data` EmailMessage[], required
    - `attachments` AttachmentResponse[], required
      - `content_id` string, nullable, required — MIME Content-ID for inline references.
      - `content_type` string, required
      - `disposition` string, required — MIME disposition (e.g. `attachment` or `inline`). Runtime passes through the stored value without enforcing an enum.
      - `filename` string, required
      - `sha256` string, nullable, required — SHA-256 hex digest of the attachment content.
      - `size_bytes` integer, nullable, required — Attachment size in bytes.
      - `url` string, uri, nullable, required — Telnyx-hosted public URL for the attachment content.
    - `bcc` EmailAddress[], required
      - `email` string, required
      - `name` string
    - `cc` EmailAddress[], required
      - `email` string, required
      - `name` string
    - `created_at` string, date-time, required
    - `events` MessageEvent[], required
      - `occurred_at` string, date-time, required
      - `payload` object
      - `type` 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded', required
    - `from` EmailAddress, required
      - `email` string, required
      - `name` string
    - `id` string, uuid, required
    - `inline_css` boolean — Present when true in the immediate create response. Not persisted; absent on subsequent GET requests.
    - `recipient_statuses` object — Per-status recipient counts for the message. Present only for outbound messages with recipient rows. Keys are recipient statuses, values are counts. Example: `{"delivered": 998, "bounced": 2}`.
    - `record_type` 'email_message', required
    - `reply_to` string, nullable, required
    - `sandbox` boolean — Present when sandbox mode was used.
    - `scheduled_at` string, date-time — Present when a scheduled_at value was stored. Persists even after the scheduled send has been processed or cancelled.
    - `status` 'queued' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'deferred' | 'delivered' | 'bounced' | 'complained' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed', required — Current status of an email message. Lifecycle statuses (queued, scheduled, etc.) are set on creation. Delivery statuses (delivered, bounced, etc.) are updated by delivery event consumers.
    - `subject` string, required
    - `template_id` string, uuid, nullable, required
    - `template_variables` object, required
    - `to` EmailAddress[], required
      - `email` string, required
      - `name` string
  - `errors` EmailBatchItemError[], required
    - `code` 'bad_request' | 'not_found' | 'forbidden' | 'service_unavailable' | 'validation_error' | 'recipient_suppressed' | 'reputation_suspended', required — Batch item errors use `message` (not `detail`) for the human-readable text.
    - `index` integer, required — Zero-based index of the failed message in the request array.
    - `message` string, required
  - `meta` EmailBatchMeta, required
    - `failed` integer, required
    - `succeeded` integer, required
    - `total` integer, required

## Other responses

- `400` — Bad Request / Validation Failed (10015). Invalid, duplicate, empty, malformed, or overlong Idempotency-Key headers are rejected by Edge with HTTP 400 and error code 10015.
- `401` — Not authorized (10006).
- `409` — A request with the same Idempotency-Key is still being processed (10036). Retry later with the same key and request.
- `413` — Request body exceeds the 8,000,000-byte limit for this endpoint.
- `422` — The Idempotency-Key was already used for a different request (10027).
- `429` — Sending suspended — domain reputation band is 'poor'.
- `503` — Service unavailable (10016), including an unavailable upstream dependency or unavailable Edge idempotency protection for a keyed request.

---

[API](https://skmtc.net/team-telnyx/apis/telnyx-api-2.md) · [All operations](https://skmtc.net/team-telnyx/apis/telnyx-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api-2/revisions/ec31f78cf002/schema)
