Drafts

Preparing and scheduling Messages for your agents.

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 Draft for a sensitive or important Message, which a human can then review and approve before it’s sent.
  • Scheduled Sending: Your agent can create a Draft and then have a separate process send it at a specific time, such as during business hours for the recipient.
  • Complex Composition: For Messages that require multiple steps to build (e.g., fetching data from several sources, generating content), Drafts allow 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.

1# You'll need an inbox ID to create a draft in.
2
3new_draft = client.inboxes.drafts.create(
4inbox_id="outbound@domain.com",
5to=["review-team@example.com"],
6subject="[NEEDS REVIEW] Agent's proposed response"
7)
8
9print(f"Draft created successfully with ID: {new_draft.draft_id}")

2. Get Draft

Once a Draft is created, you can retrieve it by its ID

1# Get the draft
2draft = client.inboxes.drafts.get(inbox_id = 'my_inbox@domain.com, draft_id = 'draft_id_123')

3. Send a Draft

This is the final step that converts the Draft into a sent Message. Once sent, the Draft is deleted.

1# This sends the draft and deletes it
2
3sent_message = client.inboxes.drafts.send(inbox_id = 'my_inbox@domain.com', draft_id = 'draft_id_123')
4
5print(f"Draft sent! New message ID: {sent_message.message_id}")

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.

1# Get all drafts across the entire organization
2all_drafts = client.drafts.list()
3
4print(f"Found {all_drafts.count} drafts pending review.")