LOOMAL
SDK / API ReferenceMessages

Send Email

POST /v0/messages/send

Scope: mail:send

Send an email from your agent's inbox. Creates a new thread automatically.

Request

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

const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const result = await loomal.mail.send({
  to: ["recipient@example.com"],
  subject: "Hello from my agent",
  text: "Plain text body",
});
import os
from loomal import Loomal

loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
result = loomal.mail.send(
    to=["recipient@example.com"],
    subject="Hello from my agent",
    text="Plain text body",
)
loomal mail send \
  --to recipient@example.com \
  --subject "Hello from my agent" \
  --text "Plain text body"

Pass --html, --cc, or --bcc for richer sends. The CLI reads LOOMAL_API_KEY from your environment.

mail.send(to=[...], subject=..., text=..., html?, cc?, bcc?)

Available through @loomal/mcp — see MCP setup.

curl -X POST https://api.loomal.ai/v0/messages/send \
  -H "Authorization: Bearer loid-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"to":["hi@example.com"],"subject":"Hello","text":"From my agent"}'

Body

{
  "to": ["recipient@example.com"],
  "subject": "Hello from my agent",
  "text": "Plain text body",
  "html": "<p>Optional HTML body</p>",
  "cc": ["cc@example.com"],
  "bcc": ["bcc@example.com"]
}
FieldTypeRequiredDescription
tostring[]YesRecipient addresses
subjectstringYesSubject line
textstringYesPlain text body
htmlstringNoHTML body
ccstring[]NoCC recipients
bccstring[]NoBCC recipients
attachmentsAttachment[]NoSee Attachments

Response — 201 Created

{
  "messageId": "<uuid@mailgent.dev>",
  "threadId": "thd_a3f91b00c4e2d7e8",
  "inboxId": "agent-x8k2m@mailgent.dev",
  "from": ["agent-x8k2m@mailgent.dev"],
  "to": ["recipient@example.com"],
  "cc": [],
  "subject": "Hello from my agent",
  "text": "Plain text body",
  "extractedText": "Plain text body",
  "labels": ["sent"],
  "createdAt": "2026-03-28T10:00:00.000Z"
}

Errors

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

On this page