Reply to a conversation
Answer an exact message while preserving the thread.
A reply belongs to an existing thread. Mailactor constructs the sender, subject, and email reply headers for you.
Required scopes: mailbox:read to select the target, mailbox:send to reply, and delivery:read to confirm delivery.
Set MAILACTOR_API_URL and MAILACTOR_API_KEY as shown in quickstart. Examples below use illustrative IDs and values; use the values returned for your organization.
Select the message you are answering
Read the thread and save the selected message's id. Use the Mailactor ID beginning with msg_, not internetMessageId.
The API requires targetMessageId. Choosing the exact target prevents a concurrent arrival from silently changing who receives your reply.
Submit the reply
export REPLY_KEY="reply-$(uuidgen)"
export TARGET_MESSAGE_ID="msg_REPLACE_WITH_ACTUAL_ID"
PAYLOAD=$(jq -n --arg target "$TARGET_MESSAGE_ID" \
'{targetMessageId:$target,text:"Thanks, Alex. I have everything I need."}')
curl --fail-with-body --silent --show-error \
"$MAILACTOR_API_URL/v1/threads/$THREAD_ID/replies" \
-H "x-api-key: $MAILACTOR_API_KEY" \
-H "idempotency-key: $REPLY_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"{
"targetMessageId": "msg_0123456789abcdef01234567",
"text": "Thanks, Alex. I have everything I need."
}| Field | Required | Shape |
|---|---|---|
targetMessageId | Yes | Exact msg_ resource ID belonging to this thread. |
text / html | At least one | Strings; both are allowed. |
metadata | No | Same string map and limits as sending. |
Do not send to, from, subject, or replyTo; these fields are not accepted here. A successful response is 202 with the same message, submission, replayed envelope as sending; see the complete reply response. Save the new message ID and submission ID; the thread ID stays the same.
Use the same key and body for an ambiguous retry. A new reply needs a new key. The response includes message and submission; track the submission until you know the delivery outcome.
How the recipient is selected
For an inbound target, Mailactor uses the first listed Reply-To mailbox when valid; otherwise it falls back to From. For an outbound target, it uses the To recipients other than the inbox itself. The key's recipient-domain restrictions continue to apply.
Replies have one deterministic target; this is not a general reply-all API. Do not add your own recipient or threading headers to the request.
Common problems
400:targetMessageIdis missing or malformed, or the body is invalid.404: refresh the thread and check that the target belongs to the conversation you can access.403: inspect reply permissions, inbox restrictions, and recipient policy.422: there is no safe reply recipient or a recipient is suppressed.