Get Thread
Retrieve a single thread with all its messages
Overview
Retrieve complete details for a single email thread, including all messages in the conversation.
Authentication
AuthorizationstringpathrequiredInbox API Key
Path Parameters
idstringpathrequiredThe inbox ID (e.g., inb_abc123)
threadIdstringpathrequiredThe thread ID (e.g., thr_xyz789)
Request
curl -X GET https://api.daimon.email/v1/inboxes/inb_abc123/threads/thr_xyz789 \
-H "Authorization: Bearer dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o"import { DaimonClient } from 'daimon-email';
const client = new DaimonClient({
apiKey: 'dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
});
const thread = await client.inboxes.threads.get('inb_abc123', 'thr_xyz789');
console.log(`Thread: ${thread.subject}`);
console.log(`Messages: ${thread.messages.length}`);
thread.messages.forEach(msg => {
console.log(` From: ${msg.from_address}`);
console.log(` Subject: ${msg.subject}`);
console.log(` Reply: ${msg.reply_body}`);
console.log(` Links: ${msg.links.join(', ')}`);
console.log(` CTAs: ${msg.cta_links.join(', ')}`);
});from daimon_email import DaimonClient
client = DaimonClient(
api_key='dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
)
thread = client.inboxes.threads.get('inb_abc123', 'thr_xyz789')
print(f"Thread: {thread['subject']}")
print(f"Messages: {len(thread['messages'])}")
for msg in thread['messages']:
print(f" From: {msg['from_address']}")
print(f" Subject: {msg['subject']}")
print(f" Reply: {msg['reply_body']}")
print(f" Links: {', '.join(msg['links'])}")
print(f" CTAs: {', '.join(msg['cta_links'])}")Response
{
"result": {
"thread": {
"id": "thr_xyz789",
"inbox_id": "inb_abc123",
"subject": "Order Confirmation #12345",
"labels": ["important", "order"],
"message_count": 3,
"unread_count": 1,
"created_at": "2024-03-11T14:23:45Z",
"updated_at": "2024-03-11T16:45:00Z",
"messages": [
{
"id": "msg_abc001",
"from_address": "orders@shop.com",
"to_address": "my-agent@daimon.email",
"subject": "Order Confirmation #12345",
"body_text": "Thank you for your order! Your order #12345 has been confirmed...",
"body_html": "<html><body><h1>Order Confirmation</h1>...</body></html>",
"reply_body": "Thank you for your order! Your order #12345 has been confirmed...",
"links": [
"https://shop.com/orders/12345",
"https://shop.com/track/abc123"
],
"cta_links": [
"https://shop.com/track/abc123"
],
"labels": ["order"],
"read": true,
"received_at": "2024-03-11T14:23:45Z",
"attachments": []
},
{
"id": "msg_abc002",
"from_address": "my-agent@daimon.email",
"to_address": "orders@shop.com",
"subject": "Re: Order Confirmation #12345",
"body_text": "Can I change the shipping address?",
"body_html": "<html><body>Can I change the shipping address?</body></html>",
"reply_body": "Can I change the shipping address?",
"links": [],
"cta_links": [],
"labels": [],
"read": true,
"received_at": "2024-03-11T15:10:30Z",
"attachments": []
},
{
"id": "msg_abc003",
"from_address": "support@shop.com",
"to_address": "my-agent@daimon.email",
"subject": "Re: Order Confirmation #12345",
"body_text": "Yes, you can update your shipping address here: https://shop.com/orders/12345/edit",
"body_html": "<html><body>Yes, you can update your shipping address here...</body></html>",
"reply_body": "Yes, you can update your shipping address here: https://shop.com/orders/12345/edit",
"links": [
"https://shop.com/orders/12345/edit"
],
"cta_links": [
"https://shop.com/orders/12345/edit"
],
"labels": [],
"read": false,
"received_at": "2024-03-11T16:45:00Z",
"attachments": []
}
]
}
},
"next_steps": [
"Use PATCH /v1/inboxes/{id}/threads/{threadId} to update labels",
"Use PATCH /v1/inboxes/{id}/messages/{messageId} to mark individual messages as read",
"Use POST /v1/inboxes/{id}/send to reply to this thread"
]
}Response Fields
result.threadobjectComplete thread object with all messages
Thread object
idstringUnique thread identifier
inbox_idstringThe inbox this thread belongs to
subjectstringThread subject line
labelsarrayArray of label strings applied to this thread
message_countnumberTotal number of messages in this thread
unread_countnumberNumber of unread messages in this thread
created_atstringISO 8601 timestamp when thread was created
updated_atstringISO 8601 timestamp when thread was last updated
messagesarrayArray of all messages in this thread, ordered chronologically
Message object
idstringUnique message identifier
from_addressstringSender email address
to_addressstringRecipient email address
subjectstringMessage subject line
body_textstringPlain text body of the message
body_htmlstringHTML body of the message (may be null)
reply_bodystringExtracted reply text without quoted history (using TalonJS)
linksarrayAll URLs found in the message body
cta_linksarrayCall-to-action links (verify, confirm, activate, etc.)
labelsarrayArray of label strings applied to this message
readbooleanWhether this message has been marked as read
received_atstringISO 8601 timestamp when message was received
attachmentsarrayArray of attachment objects (filename, size, content_type, download_url)
next_stepsarraySuggested actions the agent can take next