Sending and replying

New messages and replies from an inbox: the fields, quoting, attachments and inline images, multipart bodies, idempotent retries, the limits, and what a refused send answers.

On this page
  1. Sending a message
  2. Replying in a thread
  3. Attachments and inline images
  4. Sending as multipart/form-data
  5. Idempotent retries
  6. Limits
  7. When a send is refused

Sending a message

POST /v1/inboxes/{inboxId}/send sends from the inbox's address, with the inbox's display name as the sender name. It works with an account key and with the inbox's own key. A new message needs to and subject; everything else is optional.

curl

curl -s -X POST "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/send" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "to": "sam@example.com",
    "subject": "Thursday",
    "text": "Thursday works."
  }'
to, cc, bcc
One address, several separated by commas, or an array. At most 50 addresses across the three.
subject
At most 998 characters. Required on a new message; a reply defaults to Re: <thread subject>.
text, html
The plain-text and HTML bodies, each at most 2,000,000 characters. Text is derived from the HTML when only html is given.
body
A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when text or html is given.
replyTo
The address replies should go to instead of the inbox.
attachments
Files to attach, below.
threadId, includeQuote
What makes the message a reply, below.

The answer is 201 with the stored outbound message, a SentMessage: the same shape as any message, direction outbound, plus providerMessageId, the identifier the sending provider assigned. Outbound messages are stored without a raw copy, so their rawUrl is null.

201 Created

{
  "id": "msg_01jc5b7h8j9k0m1n2p3q4r5s6t",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "direction": "outbound",
  "rfcMessageId": null,
  "inReplyTo": "<a1b2c3@example.com>",
  "references": [
    "<a1b2c3@example.com>"
  ],
  "from": {
    "address": "concierge@doorman.example",
    "name": "Acme concierge"
  },
  "to": [
    {
      "address": "sam@example.com",
      "name": null
    }
  ],
  "cc": [],
  "bcc": [],
  "replyTo": null,
  "deliveryRole": null,
  "subject": "Re: Invoice 2847",
  "text": "Thanks, confirming for Thursday.",
  "hasHtml": false,
  "rawUrl": null,
  "sizeBytes": 31,
  "category": "personal",
  "autoReplyable": false,
  "verdict": null,
  "spamScore": null,
  "authentication": null,
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "attachments": [],
  "providerMessageId": "<b2c3d4@doorman.example>"
}

Replying in a thread

A reply is a send with a threadId. The thread supplies what a mail client would:

  • the subject, Re: <thread subject>, unless you pass one;
  • the In-Reply-To and References headers, so the recipient's client keeps the conversation together;
  • the recipient, the last inbound message's Reply-To or its sender, unless you pass to;
  • the previous message, quoted under your text, unless includeQuote is false.

Sending a reply marks the thread read. A thread that does not exist, belongs to another inbox or was trashed answers 404 thread_not_found.

curl

curl -s -X POST "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/send" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "idempotency-key: order-2847-reply" \
  -H "content-type: application/json" \
  -d '{
    "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
    "text": "Thanks, confirming for Thursday.",
    "includeQuote": true
  }'

Attachments and inline images

attachments is an array of SendAttachment: filename, contentType and content as base64. Up to 32 per message, and the whole message, text, HTML and decoded attachments together, may be 25 MiB at most.

An image shown inside the HTML body is an inline attachment: set disposition to inline and give it a contentId, then reference it from the HTML as cid:<contentId>.

A message with an inline image

{
  "to": "sam@example.com",
  "subject": "The chart",
  "html": "<p>This week's chart:</p><img src=\"cid:chart-1\">",
  "attachments": [
    {
      "filename": "chart.png",
      "contentType": "image/png",
      "content": "iVBORw0KGgo...",
      "disposition": "inline",
      "contentId": "chart-1"
    }
  ]
}

Any type of file can be attached within that size; a larger file, a long video for example, travels as a link. Every attachment is checked by its bytes before the message leaves, and where security policies are enforced some are refused: a program or a file dressed as another kind for every caller, and a locked, damaged or macro-carrying file for keys and app tokens (Outbound guards). The stored message lists each attachment with the scan the check gave it.

Sending as multipart/form-data

The same route accepts multipart/form-data, which spares an agent the base64 step for large files: the text fields keep their names, each file goes in a repeated attachments field, and includeQuote is text (false, 0 or no turn the quote off). A body that cannot be parsed answers 400 invalid_form.

curl

curl -s -X POST "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/send" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -F "to=sam@example.com" \
  -F "subject=The report" \
  -F "text=The report is attached." \
  -F "attachments=@report.pdf;type=application/pdf"

Idempotent retries

Networks fail after a request was handled. Send an Idempotency-Key header (1 to 255 printable ASCII characters, ^[!-~]{1,255}$) and a retry is safe for 24 hours:

  • the same key with the same request replays the original answer, with the header Idempotent-Replayed: true, and nothing is sent again;
  • the same key with a different request is refused with 422 idempotency_key_reused;
  • a key whose first attempt is still running answers 409 idempotency_in_progress;
  • a failed send releases the key, so the same key can be retried after the cause is fixed.

Keys are per inbox. Derive them from what the send is about, such as the order or the thread and the step, rather than from a timestamp. Idempotency has how each SDK, the command line and the MCP server pass the key.

Limits

LimitValueWhen it is reached
Sends per minute, per inbox10429 rate_limit_exceeded with Retry-After, scope: "inbox", limit and resetsAt. Refused sends are not counted.
Sends per UTC day, per inbox200The same 429.
Sends per UTC day, per account, every plan500 across all inboxes; 20 while the account is younger than 7 days429 rate_limit_exceeded with Retry-After, scope: "account", limit and resetsAt. The shared domain's sending reputation is everyone's, so the cap does not depend on the plan.
Sends per month, Free plan3000 per account, replies included402 plan_limit_reached with scope: "account", plan, limit, used and resetsAt, the first instant of the next month. No Retry-After: upgrade rather than wait.
Recipients50 across to, cc and bcc400 validation_error.
Attachments32400 validation_error.
Message size25 MiB, attachments decoded413 message_too_large.
Subject998 characters400 validation_error.
Each body field2,000,000 characters400 validation_error.

When a send is refused

The API maps the sending provider's outcomes to its own codes and never echoes the provider's message. providerCode carries the provider's reason where there is one.

StatusErrorMeaning
400recipient_suppressedA recipient previously bounced or complained and is suppressed.
403recipient_not_permittedA recipient is not permitted for this deployment.
413message_too_largeThe message exceeds the size limit, including attachments.
400send_rejectedThe sending provider rejected the message; providerCode carries its reason.
429provider_rate_limitedThe sending provider is rate limiting this deployment.
503sending_pausedSending is paused for this deployment pending review.
503sending_unavailableThe inbox domain is not onboarded for sending, or sending is not configured.
502send_failedThe sending provider did not accept or could not deliver the message; providerCode carries its reason.

Before the provider is involved: 400 validation_error names the field, 400 invalid_json and invalid_form mean the body could not be read, 403 risk_blocked (with guard set to reply or recipient) means the security policy blocked an agent reply in a flagged thread or a send to an unknown recipient, 403 risk_blocked with guard set to content means an attachment or a link did not pass its check and reasons says why, 503 scan_unavailable means an attachment could not be checked in time and the send is safe to repeat after Retry-After, 404 thread_not_found covers a reply to a thread that is not the inbox's, and 403 inbox_suspended means the inbox cannot send at the moment. The reference entry lists every code the route answers.

Up Down to move, Enter to open, Esc to close