Api referenceDrafts
Get Draft
Retrieve a single draft by ID
Overview
Retrieve complete details for a single email draft.
Authentication
AuthorizationstringpathrequiredInbox API Key
Path Parameters
idstringpathrequiredThe inbox ID (e.g., inb_abc123)
draftIdstringpathrequiredThe draft ID (e.g., dft_abc123)
Request
curl -X GET https://api.daimon.email/v1/inboxes/inb_abc123/drafts/dft_abc123 \
-H "Authorization: Bearer dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o"import { DaimonClient } from 'daimon-email';
const client = new DaimonClient({
apiKey: 'dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
});
const draft = await client.inboxes.drafts.get('inb_abc123', 'dft_abc123');
console.log(`To: ${draft.to}`);
console.log(`Subject: ${draft.subject}`);
console.log(`Body: ${draft.body_text}`);
if (draft.send_at) {
console.log(`Scheduled for: ${draft.send_at}`);
}from daimon_email import DaimonClient
client = DaimonClient(
api_key='dm_free_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
)
draft = client.inboxes.drafts.get('inb_abc123', 'dft_abc123')
print(f"To: {draft['to']}")
print(f"Subject: {draft['subject']}")
print(f"Body: {draft['body_text']}")
if draft['send_at']:
print(f"Scheduled for: {draft['send_at']}")Response
{
"result": {
"id": "dft_abc123",
"inbox_id": "inb_abc123",
"to": "customer@example.com",
"cc": ["manager@example.com"],
"bcc": [],
"subject": "Your order is ready",
"body_text": "Hi there,\n\nYour order #12345 has been processed and is ready for pickup.\n\nBest,\nSupport Team",
"body_html": "<html><body><p>Hi there,</p><p>Your order #12345 has been processed and is ready for pickup.</p><p>Best,<br>Support Team</p></body></html>",
"send_at": null,
"thread_id": "thr_xyz789",
"labels": ["customer-service", "order"],
"created_at": "2024-03-11T14:23:45Z",
"updated_at": "2024-03-11T15:10:30Z"
},
"next_steps": [
"Use POST /v1/inboxes/{id}/drafts/{draftId}/send to send this draft",
"Use PATCH /v1/inboxes/{id}/drafts/{draftId} to edit the draft",
"Use DELETE /v1/inboxes/{id}/drafts/{draftId} to discard this draft"
]
}Response Fields
result.idstringUnique draft identifier (e.g., dft_abc123)
result.inbox_idstringThe inbox this draft belongs to
result.tostringRecipient email address
result.ccarrayArray of CC email addresses
result.bccarrayArray of BCC email addresses
result.subjectstringEmail subject line
result.body_textstringPlain text email body
result.body_htmlstringHTML email body (may be null)
result.send_atstringISO 8601 timestamp for scheduled sending (null if not scheduled)
result.thread_idstringThread ID this draft is attached to (null if not part of a thread)
result.labelsarrayArray of label strings applied to this draft
result.created_atstringISO 8601 timestamp when draft was created
result.updated_atstringISO 8601 timestamp when draft was last updated
next_stepsarraySuggested actions the agent can take next