MailgentMailgent
Getting Started

Reply to Email

Reply to an incoming email in a thread

When your agent receives an email, it can reply — keeping the conversation in the same thread.

Via MCP

Agent calls mail.reply:
  messageId: "<abc123@gmail.com>"
  text: "Thanks for reaching out! Here's the info..."

Via API

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

What Happens

  • Subject is prefixed with Re: automatically
  • In-Reply-To and References headers are set (proper threading)
  • Reply goes to the original sender
  • Message is added to the same thread

Response

{
  "messageId": "<new-uuid@mailgent.dev>",
  "threadId": "thd_f8e2a1c4d7b90e3f",
  "subject": "Re: Question about pricing",
  "labels": ["sent"]
}

The threadId matches the original message — the conversation stays threaded.

On this page