PATCH/inboxes/{inbox_id}/drafts/{draft_id}

Update an inbox draft

Updates the content of an unsent draft in an inbox. Send only the fields you want to change; sending attachments replaces all attachments, while sending text or html replaces the entire body. The merged draft must retain at least one non-empty field and no more than 50 combined recipients.

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

2 parameters · 7 body fields
inbox_idstringrequired
The UUID of the inbox containing the draft; an email address is not accepted.
draft_idstringrequired
The UUID of the draft to update.

Fields to change on the draft. Omitted fields remain unchanged; sending text or html replaces the whole body, and sending attachments replaces every stored attachment.

tostringrequired
The recipients. For multiple addresses, send an array of strings. Each value can include a friendly name. Pass `null` to clear. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.
ccstringoptional
The CC recipients. Pass `null` or `[]` to clear. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.
bccstringoptional
The BCC recipients. Pass `null` or `[]` to clear. 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. Cannot be only whitespace or contain a line break. Pass `null` to clear.
htmlstringoptional
The HTML body. Pass `null` to clear.
textstringoptional
The plain text body. Pass `null` to clear.
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. Sending the field replaces every attachment on the draft. Send `[]` to remove them all. `null` also removes them all.

1 status code
200Returns the updated draft, including its recipients, content, thread association, timestamps, and stored attachments.
objectstringrequired
The object type.
idstringrequired
The ID of the draft.
typestringrequired
`reply` when the draft replies to an email in an existing thread. `standalone` when the draft starts a new thread.
Allowed:standalonereply
toarrayrequired
The recipients. `null` or empty when no recipients are set.
ccarray<string>required
The CC recipients.
bccarray<string>required
The BCC recipients.
subjectstringrequired
The subject.
htmlstringrequired
The HTML body.
textstringrequired
The plain text body. A reply draft created without a body has an empty string.
thread_idstringrequired
The Thread ID when the draft is a reply. `null` otherwise.
reply_to_email_idstringrequired
The Email ID the draft replies to. `null` otherwise.
email_idstringrequired
The ID of the outbound email queued when the draft was sent. `null` until the draft is sent.
created_atstringrequired
Timestamp when the draft was created.
updated_atstringrequired
Timestamp when the draft was last saved.
attachmentsarray<object>required
The files stored on the draft.

Error handling

The inbox_id and draft_id path parameters must be UUIDs identifying the inbox and draft. Include at least one of to, cc, bcc, subject, text, html, or attachments; the merged draft must retain at least one non-empty field, and its combined recipient count cannot exceed 50. subject must be 1 to 2000 characters and cannot contain only whitespace or a line break; each attachment must include non-empty content, filename, and content_type.