LOOMAL
SDK / API ReferenceMessages

Reply to Email

POST /v0/messages/:messageId/reply

Scope: mail:send

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

Request

import { Loomal } from "@loomal/sdk";

const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const reply = await loomal.mail.reply("<msg-id@gmail.com>", {
  text: "Thanks for your question! Here's the answer...",
});
import os
from loomal import Loomal

loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
reply = loomal.mail.reply(
    "<msg-id@gmail.com>",
    text="Thanks for your question! Here's the answer...",
)
loomal mail reply '<msg-id@gmail.com>' \
  --text "Thanks for your question! Here's the answer..."

Pass --html for an HTML body. Quote the messageId — it contains <>@.

mail.reply(message_id, text=..., html?)

Available through @loomal/mcp — see MCP setup.

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

Body

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

Response — 201 Created

{
  "messageId": "<new-uuid@mailgent.dev>",
  "threadId": "thd_f8e2a1c4d7b90e3f",
  "inboxId": "agent-x8k2m@mailgent.dev",
  "from": ["agent-x8k2m@mailgent.dev"],
  "to": ["sender@example.com"],
  "cc": [],
  "subject": "Re: Question about pricing",
  "text": "Thanks for your question! Here's the answer...",
  "extractedText": "Thanks for your question! Here's the answer...",
  "labels": ["sent"],
  "createdAt": "2026-03-28T14:30:00.000Z"
}

Errors

StatusCodeDescription
404not_foundOriginal message not found
429quota_exceededDaily send limit reached (50/day)

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

On this page