inboxes > drafts

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:

agentmail inboxes drafts create --inbox-id <inbox_id> --to recipient@example.com --subject "Draft subject" --text "Draft body"
post/v0/inboxes/{inbox_id}/drafts

Request

  • Base URL
    https://api.agentmail.to
  • URL
    https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts
  • Auth
    HTTP bearer

Path parameters

inbox_idstring required

The ID of the inbox.

Request body

labelsstring[]

Labels of draft.

reply_tostring[]

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

tostring[]

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

ccstring[]

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

bccstring[]

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

subjectstring

Subject of draft.

textstring

Plain text body of draft.

htmlstring

HTML body of draft.

in_reply_tostring

ID of message being replied to.

forward_ofstring

ID of message being forwarded.

reply_allboolean

Reply to all recipients of the original message.

send_atstring date-time

Time at which to schedule send draft.

client_idstring

Client ID of draft.

Response

Response with status 200

inbox_idstring required

The ID of the inbox.

draft_idstring required

ID of draft.

client_idstring

Client ID of draft.

labelsstring[] required

Labels of draft.

reply_tostring[]

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

tostring[]

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

ccstring[]

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

bccstring[]

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

subjectstring

Subject of draft.

previewstring

Text preview of draft.

textstring

Plain text body of draft.

htmlstring

HTML body of draft.

in_reply_tostring

ID of message being replied to.

forward_ofstring

ID of message being forwarded.

referencesstring[]

IDs of previous messages in thread.

send_status'scheduled' | 'sending' | 'failed'

Schedule send status of draft.

send_atstring date-time

Time at which to schedule send draft.

updated_atstring date-time required

Time at which draft was last updated.

created_atstring date-time required

Time at which draft was created.

Changes

    • breaking

      the request property became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property // became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • info

      the endpoint scheme security Bearer was added to the API

    • info

      the endpoint scheme security BearerAuth was removed from the API

    • info

      api tag inboxes > drafts added

    • info

      api tag InboxesDrafts removed

    • info

      request body became optional

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status