Overview
Drafts allow you to save email messages before sending them. This is useful for composing emails over time, scheduling sends, or building approval workflows.Draft Structure
A draft has the same structure as a message, stored in the Drafts folder:| Field | Type | Description |
|---|---|---|
uid | integer | Unique identifier within the mailbox |
from | string | Sender email address |
to | string[] | Recipient email addresses |
cc | string[] | CC recipients |
bcc | string[] | BCC recipients |
subject | string | Email subject line |
text | string | Plain text body |
html | string | HTML body |
attachments | object[] | List of attachments |
Operations
Create a Draft
Save a new draft:List Drafts
Retrieve all drafts:Update a Draft
Modify an existing draft:Send a Draft
Convert a draft into a sent email:When you send a draft, it is automatically moved from the Drafts folder to Sent.
Delete a Draft
Remove a draft without sending:Use Cases
Email Scheduling
Email Scheduling
Create drafts and send them later at a scheduled time using your application logic.
Approval Workflows
Approval Workflows
Save emails as drafts, send them through an approval process, then send once approved.
AI Composition
AI Composition
Let AI agents compose draft responses for human review before sending.
Template Storage
Template Storage
Store commonly used email templates as drafts for quick access.
AI Agent Workflow Example
A common pattern for AI email agents:Best Practices
Auto-save frequently
Auto-save frequently
If building a compose UI, auto-save drafts every few seconds to prevent data loss.
Clean up old drafts
Clean up old drafts
Periodically review and delete old drafts that are no longer needed.
Use drafts for review workflows
Use drafts for review workflows
For sensitive communications, use drafts to enable human review before sending.