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>"
}| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Plain text reply |
html | string | No | HTML reply |
attachments | Attachment[] | No | See 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
| Status | Code | Description |
|---|---|---|
404 | not_found | Original message not found |
429 | quota_exceeded | Daily send limit reached (50/day) |
Threading
- Subject prefixed with
Re:automatically In-Reply-Toheader set to the original messageIdReferencesheader includes full chain- Same
threadIdas the original