Reply to Message
Reply to an email or reply to all recipients (requires paid tier)
Warning
Paid tier required - Sending emails requires a paid tier subscription.
Endpoints
POST /v1/inboxes/{id}/messages/{msgId}/reply- Reply to sender onlyPOST /v1/inboxes/{id}/messages/{msgId}/reply-all- Reply to all recipients (sender + CC)
Authentication
Requires the inbox's API key in the Authorization header.
Path Parameters
idstringpathrequiredInbox ID (e.g., inb_abc123)
msgIdstringpathrequiredMessage ID of the email you're replying to (e.g., msg_xyz789)
Request Body
Reply
tostringbodyOverride recipient (defaults to original sender). Optional.
ccstring or arraybodyAdditional CC recipients (optional)
bccstring or arraybodyBCC recipients (optional)
subjectstringbodySubject line (defaults to "Re: [original subject]")
bodystringbodyrequiredPlain text reply body
body_htmlstringbodyHTML reply body (optional)
client_idstringbodyIdempotency key - prevents duplicate sends on retry
send_atstringbodyISO 8601 datetime - schedule for future delivery (optional)
Reply All
subjectstringbodySubject line (defaults to "Re: [original subject]")
bodystringbodyrequiredPlain text reply body
body_htmlstringbodyHTML reply body (optional)
client_idstringbodyIdempotency key
send_atstringbodySchedule for future delivery (optional)
Info
Reply-all automatically includes all original recipients (sender + CC) minus your own inbox address. You do not need to specify to or cc fields.
Request
curl -X POST "https://api.daimon.email/v1/inboxes/inb_abc123/messages/msg_xyz789/reply" \
-H "Authorization: Bearer dm_live_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o" \
-H "Content-Type: application/json" \
-d '{
"body": "Thanks for your message! I'\''ll get back to you soon.",
"client_id": "reply-001"
}'curl -X POST "https://api.daimon.email/v1/inboxes/inb_abc123/messages/msg_xyz789/reply-all" \
-H "Authorization: Bearer dm_live_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o" \
-H "Content-Type: application/json" \
-d '{
"body": "Thanks everyone! I'\''ll review and respond shortly.",
"client_id": "reply-all-001"
}'const client = new DaimonClient({ apiKey: 'dm_live_...' });
const reply = await client.inboxes.messages.reply('inb_abc123', 'msg_xyz789', {
body: 'Thanks for your message! I\'ll get back to you soon.',
clientId: 'reply-001'
});
console.log(`Sent reply: ${reply.message_id}`);
console.log(`Thread ID: ${reply.thread_id}`);
console.log(`In-Reply-To: ${reply.in_reply_to}`);const client = new DaimonClient({ apiKey: 'dm_live_...' });
const replyAll = await client.inboxes.messages.replyAll('inb_abc123', 'msg_xyz789', {
body: 'Thanks everyone! I\'ll review and respond shortly.',
clientId: 'reply-all-001'
});
console.log(`Sent to: ${replyAll.recipients.to.join(', ')}`);
console.log(`CC: ${replyAll.recipients.cc.join(', ')}`);client = DaimonClient(api_key='dm_live_...')
reply = client.inboxes.messages.reply('inb_abc123', 'msg_xyz789', {
'body': 'Thanks for your message! I\'ll get back to you soon.',
'client_id': 'reply-001'
})
print(f"Sent reply: {reply.message_id}")
print(f"Thread ID: {reply.thread_id}")
print(f"In-Reply-To: {reply.in_reply_to}")client = DaimonClient(api_key='dm_live_...')
reply_all = client.inboxes.messages.reply_all('inb_abc123', 'msg_xyz789', {
'body': 'Thanks everyone! I\'ll review and respond shortly.',
'client_id': 'reply-all-001'
})
print(f"Sent to: {', '.join(reply_all.recipients['to'])}")
print(f"CC: {', '.join(reply_all.recipients['cc'])}")Response
Response
{
"result": {
"id": "msg_reply123",
"status": "sent",
"message_id": "<reply123@daimon.email>",
"sent_at": "2024-03-11T14:25:30Z",
"in_reply_to": "<original@example.com>",
"thread_id": "thr_def456"
},
"next_steps": [
"Reply sent successfully",
"Message is part of thread thr_def456",
"Check /v1/inboxes/{id}/threads/thr_def456 for full conversation"
]
}{
"result": {
"id": "msg_replyall456",
"status": "sent",
"message_id": "<replyall456@daimon.email>",
"sent_at": "2024-03-11T14:25:30Z",
"in_reply_to": "<original@example.com>",
"thread_id": "thr_def456",
"recipients": {
"to": ["sender@example.com"],
"cc": ["colleague@example.com", "manager@example.com"]
}
},
"next_steps": [
"Reply sent to all recipients",
"Message is part of thread thr_def456",
"Future replies will continue threading automatically"
]
}{
"error": "SEND_REQUIRES_PAID",
"message": "Sending emails requires a paid tier subscription",
"upgrade_context": {
"operator_action_url": "https://daimon.email/upgrade?token=...",
"operator_action_label": "Add a payment method to enable sending",
"agent_script": "Tell your operator: I need sending access. Here's a direct upgrade link: https://daimon.email/upgrade?token=..."
},
"next_steps": [
"Present the upgrade link to your operator",
"After upgrade, retry with the same client_id for idempotency"
]
}Response Fields
result.idstringSent reply message ID
result.statusstringDelivery status: queued, sent, or scheduled
result.message_idstringRFC 5322 Message-ID header of the reply
result.sent_atstringISO 8601 timestamp of when the reply was sent
result.in_reply_tostringMessage-ID of the original message (sets In-Reply-To header)
result.thread_idstringThread UUID - all messages in this conversation share the same thread_id
result.recipientsobject(Reply-all only) Object containing to and cc arrays
next_stepsarrayAgent guidance for next actions
Auto-Threading
Both reply and reply-all automatically:
- Set the
In-Reply-Toheader to the original message'sMessage-ID - Set the
Referencesheader to include all previous Message-IDs in the thread - Attach the reply to the same
thread_idas the original message - Prepend "Re: " to the subject line if not already present
This ensures proper email threading in all email clients.
Use Cases
Auto-reply to verification emails
// Agent polls for verification emails
const messages = await client.inboxes.messages.list('inb_abc123', {
label: 'verification',
limit: 1
});
if (messages.messages.length > 0) {
const msg = messages.messages[0];
// Reply confirming verification
await client.inboxes.messages.reply('inb_abc123', msg.id, {
body: 'Confirmed! Thank you.',
clientId: `verify-reply-${msg.id}`
});
}Reply-all to group discussions
// Agent detects a message with multiple recipients
const message = await client.inboxes.messages.get('inb_abc123', 'msg_xyz789');
if (message.headers['cc']) {
// Use reply-all to include everyone
await client.inboxes.messages.replyAll('inb_abc123', message.id, {
body: 'I agree with this proposal. Moving forward with implementation.',
clientId: `group-reply-${message.id}`
});
}Scheduled follow-up reply
// Agent schedules a reply for tomorrow
await client.inboxes.messages.reply('inb_abc123', 'msg_xyz789', {
body: 'Following up on our previous discussion...',
sendAt: '2024-03-12T09:00:00Z',
clientId: 'followup-001'
});Track conversation threads
// Reply and then fetch full thread
const reply = await client.inboxes.messages.reply('inb_abc123', 'msg_xyz789', {
body: 'Thanks for the update!',
clientId: 'reply-002'
});
// Get all messages in this conversation
const thread = await client.inboxes.threads.get('inb_abc123', reply.thread_id);
console.log(`Thread has ${thread.messages.length} messages`);
thread.messages.forEach(msg => {
console.log(`${msg.from_address}: ${msg.subject}`);
});