daimon.email
Api referenceDrafts

Get Draft

Retrieve a single draft by ID

Overview

Retrieve complete details for a single email draft.

Authentication

Authorizationstringpathrequired

Inbox API Key

Path Parameters

idstringpathrequired

The inbox ID (e.g., inb_abc123)

draftIdstringpathrequired

The 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.idstring

Unique draft identifier (e.g., dft_abc123)

result.inbox_idstring

The inbox this draft belongs to

result.tostring

Recipient email address

result.ccarray

Array of CC email addresses

result.bccarray

Array of BCC email addresses

result.subjectstring

Email subject line

result.body_textstring

Plain text email body

result.body_htmlstring

HTML email body (may be null)

result.send_atstring

ISO 8601 timestamp for scheduled sending (null if not scheduled)

result.thread_idstring

Thread ID this draft is attached to (null if not part of a thread)

result.labelsarray

Array of label strings applied to this draft

result.created_atstring

ISO 8601 timestamp when draft was created

result.updated_atstring

ISO 8601 timestamp when draft was last updated

next_stepsarray

Suggested actions the agent can take next