MailgentMailgent
API ReferenceMessages

Reply to Email

POST /v0/messages/:messageId/reply

Reply to an existing email. The reply is automatically threaded.

Scope: mail:send

POST /v0/messages/{messageId}/reply

Request

{
  "text": "Thanks for your question! Here's the answer...",
  "html": "<p>Optional HTML reply</p>"
}
FieldTypeRequiredDescription
textstringYesPlain text reply
htmlstringNoHTML reply

Response 201

{
  "messageId": "<new-uuid@mailgent.dev>",
  "threadId": "thd_f8e2a1c4d7b90e3f",
  "subject": "Re: Question about pricing",
  "labels": ["sent"],
  "createdAt": "2026-03-28T14:30:00.000Z"
}

Threading

  • Subject prefixed with Re: automatically
  • In-Reply-To header set to the original messageId
  • References header includes full chain
  • Same threadId as the original

cURL

curl -X POST https://api.mailgent.dev/v0/messages/%3Cmsg-id%40gmail.com%3E/reply \
  -H "Authorization: Bearer mgent-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"text":"Thanks! Here is the info you requested."}'

MCP

Tool: mail.reply

On this page