---
title: "Send a message"
method: POST
path: "/messages"
tags: ["Messages"]
---

# Send a message

`POST /messages`

## Request

- Base URL: `https://shipmail.to/api/v1`
- URL: `https://shipmail.to/api/v1/messages`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://shipmail.to/api/auth/oauth2/authorize`, token URL `https://shipmail.to/api/auth/oauth2/token`)

Send an email from a mailbox. Provide from (email address) or mailbox_id to identify the sender. Prefer from when you know the mailbox email address; Shipmail resolves it to a mailbox ID. At least one of html or text is required. Total recipients (to + cc + bcc) must not exceed 50. Attachments are base64-encoded, max 20 files, 3 MB per file, 3 MB total. To send from a transactional sender (https://shipmail.to/docs/features/transactional-email), set from to its bare address; mailbox_id is optional and, when set, must be the sender's mailbox. Shipmail adds the sender name and Reply-To. Transactional senders send immediately only and refuse scheduled_at, track_reply: true, staged_attachment_ids, a different reply_to and a different display name. A transactional email send that reaches a ceiling returns 429 with details[].code application_daily_limit (daily ceiling for transactional email, a share of the organization's daily sending limit), application_unique_recipients (hourly ceiling of different recipients) or application_storage_full (the sender's mailbox has no transactional email storage left).

## Headers

- `Idempotency-Key` string
- `X-Shipmail-Organization` string

## Request body

- SendMessageRequest: Request body for sending a message. Provide either from or mailbox_id to identify the sending mailbox.
  - `from` string: Sending mailbox, as a bare address (hello@example.com) or RFC 5322 name-addr (Acme Support <hello@example.com>). Shipmail resolves the address to a mailbox ID server-side. A display name applies to this send only; a bare address uses the mailbox display name. For a transactional sender, pass the bare sender address; the sender's display name is added, and a different name is refused.
  - `mailbox_id` string: ID of the sending mailbox. Alternative to from.
  - `to` Recipient[], required: To recipients (at least one).
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `cc` Recipient[]: CC recipients.
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `bcc` Recipient[]: BCC recipients.
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `reply_to` union: Email recipient. Either an object with address and optional name, or a string.
    - object
      - `address` string, email, required: Email address.
      - `name` string, nullable: Display name (optional).
    - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `subject` string, required: Email subject.
  - `html` string: HTML body. At least one of html or text is required.
  - `text` string: Plain text body. At least one of html or text is required.
  - `in_reply_to` string: Message-ID this message replies to, sent as the In-Reply-To header. The message joins the conversation of the stored message with this Message-ID when it is found in exactly one conversation of the mailbox; otherwise it starts its own. It never merges conversations.
  - `references` string[]: Message-IDs sent as the References header, for threading in the recipient's mail client. They never decide or merge conversations.
  - `attachments` Attachment[]: Deprecated base64 attachments. Max 20 attachments, 3 MB per file, 3 MB total. Prefer staged_attachment_ids.
    - `filename` string, required: Filename for the attachment.
    - `content` string, byte, required: Base64-encoded file content.
    - `content_type` string: MIME type. Defaults to application/octet-stream.
  - `staged_attachment_ids` string[]: IDs returned by POST /mailboxes/{id}/staged-attachments. IDs must belong to this API key, organization, and sending mailbox.
  - `client_reference` string: Caller-defined correlation reference, unique within an organization and mode. Sending again from the same mailbox with a reference already in use returns the original message (201) and sends nothing; the new body is not compared. The same reference from a different mailbox returns 409.
  - `metadata` MessageMetadata: Up to 20 scalar values and 8 KB of JSON. Nested objects and arrays are rejected.
  - `source_rfc_message_id` string: Caller-selected source RFC Message-ID. Its domain must equal the actual sender domain.
  - `headers` OutboundHeader[]: Safe outbound headers. Shipmail, SES, routing, and identity headers are rejected. RFC 8058 requires List-Unsubscribe-Post: List-Unsubscribe=One-Click and an HTTPS List-Unsubscribe URL.
    - `name` string, required: List-Unsubscribe, List-Unsubscribe-Post, or a non-reserved X-* header.
    - `value` string, required
  - `scheduled_at` string, date-time: Optional UTC ISO 8601 time to send later. Past or near-immediate times are sent immediately.
  - `track_reply` boolean: Track the conversation in the Waiting workflow. true tracks it, false explicitly untracks it, and omitting the field keeps the thread's current tracking: a reply sent on a tracked conversation stays tracked. A tracked conversation moves to Needs action when a human reply arrives; automated replies (out-of-office, auto-acknowledgements, delivery notifications) do not end the wait.
  - `sandbox_outcome` 'delivered' | 'bounced' | 'complained': Synthetic final outcome for a sandbox send. Only accepted with a test API key.

## Response `201`

Message queued for delivery.

- Message
  - `object` 'message', required
  - `id` string, required
  - `mailbox_id` string, required
  - `thread_id` string, nullable, required: Deprecated and not stable: a legacy thread ID that changes when the mail server re-threads its IDs or a relayed send's placeholder key is replaced. It remains supported in thread paths; store conversation_id instead.
  - `conversation_id` string, nullable, required: Stable Shipmail conversation identifier (thd_...). Store this: it survives thread merges and mail-server re-threading, which thread_id does not.
  - `source_rfc_message_id` string, nullable, required: Source RFC Message-ID supplied by the caller or observed before relay.
  - `delivered_rfc_message_id` string, nullable, required: Exact provider-assigned delivered RFC Message-ID after Shipmail observes it in a recipient reply. Null before an observation and never reconstructed from the SES provider ID.
  - `client_reference` string, nullable, required: Caller-defined organization-scoped reference.
  - `metadata` MessageMetadata, required: Up to 20 scalar values and 8 KB of JSON. Nested objects and arrays are rejected.
  - `headers` OutboundHeader[], required: Safe outbound headers. Shipmail, SES, routing, and identity headers are rejected. RFC 8058 requires List-Unsubscribe-Post: List-Unsubscribe=One-Click and an HTTPS List-Unsubscribe URL.
    - `name` string, required: List-Unsubscribe, List-Unsubscribe-Post, or a non-reserved X-* header.
    - `value` string, required
  - `subject` string, nullable, required
  - `from_address` string, nullable, required
  - `to_addresses` Recipient[], nullable, required
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `cc_addresses` Recipient[], nullable, required
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `bcc_addresses` Recipient[], nullable, required
    - union: Email recipient. Either an object with address and optional name, or a string.
      - object
        - `address` string, email, required: Email address.
        - `name` string, nullable: Display name (optional).
      - string: Email address as a string. Accepts plain address ("user@example.com") or display name format ("Jane Doe <user@example.com>").
  - `attachments` AttachmentMetadata[], nullable, required: Attachment metadata (filename, size, content_type). Null if no attachments.
    - `filename` string, required
    - `size` integer, required: Size in bytes.
    - `content_type` string, required
  - `source` 'api' | 'dashboard' | 'newsletter' | 'inbound' | 'smtp' | 'assistant', required
  - `mode` 'live' | 'test', required: The API-key data plane that owns this resource. Test resources are isolated from live delivery, quota, suppression, and reputation.
  - `status` 'scheduled' | 'queued' | 'sent' | 'delivered' | 'bounced' | 'complained' | 'failed' | 'suppressed' | 'cancelled', required
  - `rule_disposition` object, nullable, required: Inbox rule evaluation recorded when this inbound tracked message was delivered. Null for outbound messages, messages ingested before rule disposition was recorded, or messages delivered while rule evaluation was unavailable.
    - `matched_rule_ids` string[], required: IDs of the inbox rules that matched this message, in evaluation order.
    - `stop_rule_id` string, nullable, required: ID of the matching inbox rule whose stop setting ended further rule processing, or null if processing was not stopped.
  - `scheduled_at` string, date-time, nullable, required: UTC ISO 8601 time when a scheduled message should be sent. Null for immediate messages.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `403`: Plan quota exceeded (type quota_exceeded), or the from address is a transactional sender that is turned off, that this API key cannot send from, or whose mailbox differs from mailbox_id (type authorization_error, details[].code transactional_sender_unavailable).
- `409`: Resource conflict.
- `422`: Validation failed. For a transactional sender, details[].code is transactional_sender_immediate_only (scheduled_at set), transactional_sender_no_reply_tracking (track_reply true), transactional_sender_reply_to (reply_to differs from the sender's Reply-To), transactional_sender_staged_attachments (staged_attachment_ids set) transactional_sender_display_name (from carries a different display name) or recipient_disposable (the sender refuses temporary email addresses and a recipient uses one).
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/shipmail/apis/shipmail-api.md) · [All operations](https://skmtc.dev/shipmail/apis/shipmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shipmail/apis/shipmail-api/revisions/2c23e59d7e30?raw)
