POST/inboxes/{inbox_id}/drafts

Create an inbox draft

Creates an unsent draft in an inbox, either as a new thread or as a reply in an existing thread. Supply at least one non-empty recipient, subject, body, or attachment field; reply drafts require both thread_id and reply_to_email_id. If a reply draft already exists for the target email, the response returns its ID and only a supplied attachments value is applied.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 9 body fields
inbox_idstringrequired
The UUID of the inbox where the draft will be created; an email address is not accepted.
Idempotency-Keystringoptional
A unique key to prevent duplicate draft creation; retries with the same key within 24 hours return the first successful response. If supplied, the key must be 1 to 256 characters.

Draft recipients, content, and optional reply-thread details and attachments. For a reply draft, provide both thread_id and reply_to_email_id.

tostringoptional
The recipients. For multiple addresses, send an array of strings. Each value can include a friendly name, for example `Ada Lovelace <ada@example.org>`. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.
ccstringoptional
The CC recipients. For multiple addresses, send an array of strings. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.
bccstringoptional
The BCC recipients. For multiple addresses, send an array of strings. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.
subjectstringoptional
The subject. Max 2000 characters. A string that is only whitespace, or that contains a line break, is rejected.
htmlstringoptional
The HTML body.
textstringoptional
The plain text body.
attachmentsarrayoptional
Files to store on the draft. Each one needs `content`, `filename` and `content_type`. A `path` without `content` returns a 422, and when both are sent, `path` is ignored. A `content_id` returns a 422. The files on a draft can total at most 25 MB. An empty file or a blocked file type returns a 422.
thread_idstringoptional
The Thread ID to reply in. Must be sent with `reply_to_email_id`.
reply_to_email_idstringoptional
The Email ID to reply to, as returned in `data[].id` by the list thread emails endpoint. Must be sent with `thread_id`.

2 status codes
200Returns the ID of the existing reply draft when one already targets the specified email; other request fields are not applied, except that `attachments` replaces the draft's attachments.
objectstringrequired
Type of the response object.
idstringrequired
The ID of the draft.
201Returns the ID of the newly created draft.
objectstringrequired
Type of the response object.
idstringrequired
The ID of the draft.

Error handling

The inbox_id path parameter must be a UUID. At least one of to, cc, bcc, subject, text, html, or attachments must be non-empty, and the combined recipient count across to, cc, and bcc cannot exceed 50. Supply thread_id and reply_to_email_id together or omit both; each attachment must include non-empty base64 content, filename, and content_type.