Get Message
Retrieve a single message with full details including attachments
Authentication
Requires the inbox's API key in the Authorization header.
Path Parameters
idstringpathrequiredInbox ID (e.g., inb_abc123)
msgIdstringpathrequiredMessage 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.idstringMessage ID
result.inbox_idstringParent inbox ID
result.thread_idstringThread ID - groups related messages
result.from_addressstringSender email address
result.to_addressstringRecipient email address (your inbox)
result.subjectstringEmail subject line
result.body_textstringFull plain text body
result.body_htmlstringFull HTML body (if available)
result.reply_bodystringExtracted reply text without quoted history (via TalonJS) - use this for agent processing
result.linksarrayAll URLs found in the message
result.cta_linksarrayDetected call-to-action links (verify, confirm, activate, etc.)
result.previewstringFirst ~150 characters of the message
result.labelsarrayAuto-detected labels
result.readbooleanWhether the message has been marked as read
result.attachmentsarrayArray of attachment metadata
result.attachments[].idstringAttachment ID (e.g., att_ghi012)
result.attachments[].filenamestringOriginal filename
result.attachments[].content_typestringMIME type (e.g., application/pdf, image/png)
result.attachments[].sizeintegerFile size in bytes
result.attachments[].r2_keystringInternal storage key (use attachment ID for download)
result.headersobjectRaw email headers as key-value pairs
result.received_atstringISO 8601 timestamp of when the message was received
result.created_atstringISO 8601 timestamp of when the message was stored
next_stepsarrayAgent 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
}