daimon.email
Api referenceMessages

Get Message

Retrieve a single message with full details including attachments

Authentication

Requires the inbox's API key in the Authorization header.

Path Parameters

idstringpathrequired

Inbox ID (e.g., inb_abc123)

msgIdstringpathrequired

Message ID (e.g., msg_xyz789)

Request

curl -X GET "https://api.daimon.email/v1/inboxes/inb_abc123/messages/msg_xyz789" \
  -H "Authorization: Bearer dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o"
const client = new DaimonClient({ apiKey: 'dm_free_...' });

const message = await client.inboxes.messages.get('inb_abc123', 'msg_xyz789');

console.log(`From: ${message.from_address}`);
console.log(`Subject: ${message.subject}`);
console.log(`Reply body: ${message.reply_body}`);
console.log(`Attachments: ${message.attachments.length}`);

// Access raw headers
console.log(`Message-ID: ${message.headers['message-id']}`);
console.log(`In-Reply-To: ${message.headers['in-reply-to']}`);
client = DaimonClient(api_key='dm_free_...')

message = client.inboxes.messages.get('inb_abc123', 'msg_xyz789')

print(f"From: {message.from_address}")
print(f"Subject: {message.subject}")
print(f"Reply body: {message.reply_body}")
print(f"Attachments: {len(message.attachments)}")

# Access raw headers
print(f"Message-ID: {message.headers['message-id']}")
print(f"In-Reply-To: {message.headers['in-reply-to']}")

Response

Response

{
  "result": {
    "id": "msg_xyz789",
    "inbox_id": "inb_abc123",
    "thread_id": "thr_def456",
    "from_address": "support@example.com",
    "to_address": "my-agent@daimon.email",
    "subject": "Re: Your signup request",
    "body_text": "Thanks for signing up! Your account is now active.\n\nBest,\nSupport Team",
    "body_html": "<p>Thanks for signing up! Your account is now active.</p><p>Best,<br>Support Team</p>",
    "reply_body": "Thanks for signing up! Your account is now active.",
    "links": [
      "https://example.com/dashboard"
    ],
    "cta_links": [
      "https://example.com/dashboard"
    ],
    "preview": "Thanks for signing up! Your account is now active.",
    "labels": ["confirmation"],
    "read": false,
    "attachments": [
      {
        "id": "att_ghi012",
        "filename": "welcome.pdf",
        "content_type": "application/pdf",
        "size": 45678,
        "r2_key": "attachments/inb_abc123/msg_xyz789/att_ghi012.pdf"
      }
    ],
    "headers": {
      "message-id": "<abc123@example.com>",
      "in-reply-to": "<def456@daimon.email>",
      "references": "<def456@daimon.email>",
      "date": "Mon, 11 Mar 2024 14:23:45 +0000",
      "from": "Support Team <support@example.com>",
      "to": "my-agent@daimon.email",
      "subject": "Re: Your signup request",
      "content-type": "multipart/mixed; boundary=\"----=_Part_123\""
    },
    "received_at": "2024-03-11T14:23:45Z",
    "created_at": "2024-03-11T14:23:46Z"
  },
  "next_steps": [
    "Use attachments[].id to download files via GET /v1/inboxes/{id}/messages/{msgId}/attachments/{attachId}",
    "Check headers['in-reply-to'] to determine if this is part of a thread",
    "Use reply_body instead of body_text for cleaner reply text without quoted history"
  ]
}

Response Fields

result.idstring

Message ID

result.inbox_idstring

Parent inbox ID

result.thread_idstring

Thread ID - groups related messages

result.from_addressstring

Sender email address

result.to_addressstring

Recipient email address (your inbox)

result.subjectstring

Email subject line

result.body_textstring

Full plain text body

result.body_htmlstring

Full HTML body (if available)

result.reply_bodystring

Extracted reply text without quoted history (via TalonJS) - use this for agent processing

result.linksarray

All URLs found in the message

result.cta_linksarray

Detected call-to-action links (verify, confirm, activate, etc.)

result.previewstring

First ~150 characters of the message

result.labelsarray

Auto-detected labels

result.readboolean

Whether the message has been marked as read

result.attachmentsarray

Array of attachment metadata

result.attachments[].idstring

Attachment ID (e.g., att_ghi012)

result.attachments[].filenamestring

Original filename

result.attachments[].content_typestring

MIME type (e.g., application/pdf, image/png)

result.attachments[].sizeinteger

File size in bytes

result.attachments[].r2_keystring

Internal storage key (use attachment ID for download)

result.headersobject

Raw email headers as key-value pairs

result.received_atstring

ISO 8601 timestamp of when the message was received

result.created_atstring

ISO 8601 timestamp of when the message was stored

next_stepsarray

Agent guidance for next actions

Use Cases

Download attachments
const message = await client.inboxes.messages.get('inb_abc123', 'msg_xyz789');

for (const attachment of message.attachments) {
  const url = await client.inboxes.messages.attachments.get(
    'inb_abc123',
    'msg_xyz789',
    attachment.id
  );
  console.log(`Download ${attachment.filename}: ${url.url}`);
}
Check threading information
const message = await client.inboxes.messages.get('inb_abc123', 'msg_xyz789');

if (message.headers['in-reply-to']) {
  console.log(`This is a reply to: ${message.headers['in-reply-to']}`);
  console.log(`Thread ID: ${message.thread_id}`);
} else {
  console.log('This is the start of a new conversation');
}
Extract verification links
const message = await client.inboxes.messages.get('inb_abc123', 'msg_xyz789');

const verifyLink = message.cta_links.find(link =>
  link.includes('verify') || link.includes('confirm')
);

if (verifyLink) {
  console.log(`Found verification link: ${verifyLink}`);
  // Agent can now visit this URL
}