Create Draft

Create a draft. Supply `in_reply_to` to create a reply draft (with `reply_all` to address the whole thread), whose recipients, subject, and threading are derived from the referenced message, or `forward_of` to create a forward draft, which derives the subject, threading, and forwarded content from the source but keeps recipients caller-supplied. **CLI:** ```bash agentmail inboxes:drafts create --inbox-id <inbox_id> --to recipient@example.com --subject "Draft subject" --text "Draft body" ```

Authentication

AuthorizationBearer

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

Path parameters

inbox_idstringRequired
The ID of the inbox.

Request

This endpoint expects an object.
labelslist of stringsOptional
Labels 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.
textstringOptional
Plain text body of draft.
htmlstringOptional
HTML body of draft.
attachmentslist of objectsOptional
Attachments to include in draft.
in_reply_tostringOptional
ID of message being replied to.
forward_ofstringOptional
ID of message being forwarded.
reply_allbooleanOptional
Reply to all recipients of the original message.
send_atdatetimeOptional
Time at which to schedule send draft.
client_idstringOptional
Client ID of 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