Drafts
What is a Draft?
A Draft is an unsent Message. It’s a resource that allows your agent to prepare the contents of an email—including recipients, a subject, a body, and Attachments—without sending it immediately.
We know agent reliability is big these days—with Drafts you can have agents have ready-to-send emails and only with your permission it can send them off into the world.
Drafts are a key component for building advanced agent workflows. They enable:
- Human-in-the-Loop Review: An agent can create a
Draftfor a sensitive or importantMessage, which a human can then review and approve before it’s sent. - Scheduled Sending: Your agent can create a
Draftand then have a separate process send it at a specific time, such as during business hours for the recipient. - Complex Composition: For
Messagesthat require multiple steps to build (e.g., fetching data from several sources, generating content),Draftsallow you to save the state of the email as it’s being composed.
The Draft Lifecycle
You can interact with Drafts throughout their lifecycle, from creation to the moment they are sent.
1. Create a Draft
This is the first step. You create a Draft in a specific Inbox that will eventually be the sender.
2. Get Draft
Once a Draft is created, you can retrieve it by its ID
3. Send a Draft
This is the final step that converts the Draft into a sent Message. Once sent, the Draft is deleted.
Note that now we access it by message_id now because now its a message!!
Org-Wide Draft Management
Similar to Threads, you can list all Drafts across your entire Organization. This is perfect for building a central dashboard where a human supervisor can view, approve, or delete any Draft created by any agent in your fleet.
