Update Draft

Edit fields on an existing draft. Passing `null` clears a field (or `[]` for a recipient field); `send_at: null` un-schedules a scheduled draft. A draft that is already being sent cannot be edited. **CLI:** ```bash agentmail inboxes:drafts update --inbox-id <inbox_id> --draft-id <draft_id> --subject "Updated subject" ```

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

inbox_idstringRequired
The ID of the inbox.
draft_idstringRequired
ID of draft.

Request

This endpoint expects an object.
reply_tolist of strings or nullOptional

Reply-to addresses. In format username@domain.com or Display Name <username@domain.com>.

tolist of strings or nullOptional

Addresses of recipients. In format username@domain.com or Display Name <username@domain.com>.

cclist of strings or nullOptional

Addresses of CC recipients. In format username@domain.com or Display Name <username@domain.com>.

bcclist of strings or nullOptional

Addresses of BCC recipients. In format username@domain.com or Display Name <username@domain.com>.

subjectstring or nullOptional
Subject of draft.
textstring or nullOptional
Plain text body of draft.
htmlstring or nullOptional
HTML body of draft.
add_attachmentslist of objectsOptional
Attachments to add to the draft.
remove_attachmentslist of stringsOptional
IDs of attachments to remove from the draft.
add_labelslist of stringsOptional
Label or labels to add to the draft.
remove_labelslist of stringsOptional
Label or labels to remove from the draft.
send_atdatetime or nullOptional
Time at which to schedule send draft.

Response

This endpoint returns an object.
inbox_idstring
The ID of the inbox.
draft_idstring
ID of draft.
labelslist of strings
Labels of draft.
updated_atdatetime
Time at which draft was last updated.
created_atdatetime
Time at which draft was created.
client_idstringOptional
Client ID of draft.
reply_tolist of stringsOptional

Reply-to addresses. In format username@domain.com or Display Name <username@domain.com>.

tolist of stringsOptional

Addresses of recipients. In format username@domain.com or Display Name <username@domain.com>.

cclist of stringsOptional

Addresses of CC recipients. In format username@domain.com or Display Name <username@domain.com>.

bcclist of stringsOptional

Addresses of BCC recipients. In format username@domain.com or Display Name <username@domain.com>.

subjectstringOptional
Subject of draft.
previewstringOptional
Text preview of draft.
textstringOptional
Plain text body of draft.
htmlstringOptional
HTML body of draft.
attachmentslist of objectsOptional
Attachments in draft.
in_reply_tostringOptional
ID of message being replied to.
forward_ofstringOptional
ID of message being forwarded.
referenceslist of stringsOptional
IDs of previous messages in thread.
send_statusenumOptional
Schedule send status of draft.
send_atdatetimeOptional
Time at which to schedule send draft.

Errors

400
Validation Error
404
Not Found Error
409
Conflict Error