Reply to a conversation

Reply to a conversation

POST/api/v1/email/threads/{id}/reply

POST /email/threads/{id}/reply
curl -X POST 'https://www.unitpost.com/api/v1/email/threads/thr_123/reply' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
Response · 200
{
  "object": "email",
  "id": "id_123",
  "status": "queued",
  "thread_id": "thread_123"
}

Reply, reply all or forward one received message of the conversation (received_email_id), as the inbox does: your text and/or html go on top and the original is quoted under them; a reply carries In-Reply-To and References; a forward carries the attachments you list in forward_attachment_ids. The message joins the conversation and the conversation is marked read. For a reply, send to the message's reply_to addresses, else its from. It goes out now (no scheduled_at) through the same checks as any send. Pass an Idempotency-Key: a retry with it never sends twice. A copy of one of your own sends (sent_by_us) is never forwarded or quoted, since what you send isn't readable through the API: a reply to it goes without the quote, and a forward of it is a 403. Also requires emails:read (a reply quotes mail). Requires the emails:send capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
Idempotency-Keystring · headerAny unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
Request body13 fields
FieldTypeDescription
received_email_idrequiredstringThe received message (`inb_…`) in this conversation to answer or forward.
moderequiredenumreply | reply_all | forward`reply` (the sender), `reply_all` (everyone on it), or `forward` (to someone new, with the original's attachments you pick).
fromrequiredstringOne of your sending addresses, e.g. the address the message came in on.
torequiredstring | string[]For a reply: the message's `reply_to`, else its `from`. Up to 50.
ccstring | string[]Copy recipients, up to 50.
bccstring | string[]Blind-copy recipients, up to 50.
subjectrequiredstringUsually `Re: <their subject>` (or `Fwd:`).
textstringYour words, plain text. The original is quoted under them.
htmlstringYour words, HTML. The original is quoted under them.
include_quotebooleanQuote the original under a reply (default true; a forward always carries it). A copy of one of your own sends (`sent_by_us`) is never quoted: left out, it defaults to false there, and `true` is a `403`.
forward_attachment_idsstring[]Forward only: the original's attachments to carry over (their `id`s).
attachmentsobject[]Files to attach: `content` (base64) or `path` (an https URL), up to 20 with the carried-over ones.
trackingbooleanOpen and click tracking for this message; omitted = the sending domain's default.
Response · 200 fields4 fields
FieldTypeDescription
objectrequiredenumemail—
idrequiredstringThe sent email (`email_…`); read it with `GET /email/{id}`.
statusrequiredenumqueued | scheduled—
thread_idrequiredstring—
200400401403404409422429

Search docs and guides

Search the docs and product guides.