For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reply to a message

Send a reply to an inbound message. The reply is threaded to the original and its subject is prefixed with Re: (unless it already starts with one).

By default the reply is addressed to the original sender (its Reply-To, or From when absent). Pass to to override the recipients — an explicit empty array sends to cc/bcc only — or add cc/bcc.

The sender depends on the inbox type:

  • Mailtrap-hosted inbox — always sends from the inbox's own generated address. Supplying from is rejected with 400.

  • Custom-domain inbox — you supply from, whose address must belong to the inbox's domain.

post
Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
inbox_idintegerRequired

Inbound inbox ID

Example: 1
idstringRequired

Inbound message ID

Example: 1700000000000123
Body

Options for the sent message. All fields are optional. reply and reply_all must carry a body (text and/or html); forward may omit it, since the original message is quoted automatically. forward also requires at least one recipient in to. Addresses use the Email Sending API { email, name } shape.

textstringOptional

Plain-text body.

Example: Thanks for reaching out. We are looking into it.
htmlstringOptional

HTML body.

Example: <p>Thanks for reaching out. We are looking into it.</p>
categorystring · max: 255Optional

Email API category for the sent message.

Example: Support reply
Responses
201

Message queued for delivery. Returns the UUID(s) the Email API assigned to the sent message, one per recipient.

application/json
message_idsstring[]Required

UUIDs assigned by the Email API to the sent message, one per recipient. These are the sent message's UUIDs — not the inbound message ID acted on, nor an RFC Message-ID header value.

Example: ["1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"]
post/api/inbound/inboxes/{inbox_id}/messages/{id}/reply
curl -X POST https://mailtrap.io/api/inbound/inboxes/{inbox_id}/messages/{id}/reply \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "text": "Thanks for reaching out. We are looking into it." }'
{
  "message_ids": [
    "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
  ]
}

Last updated

Was this helpful?