messages

Create or update a draft message.

This endpoint allows you to:
- Create a new draft message in a new thread
- Create a draft reply to an existing message in an existing thread
- Update an existing draft message

For creating a new draft:
- Do not include messageId
- Include parentId if replying to an existing message

For updating an existing draft:
- Include messageId of the draft to update
- Only the fields that are provided will be updated

At least one of draftBody must be provided.

To add attachments, upload them first using the /api/v1.0/blob/upload/{mailbox_id}/ endpoint
and include the returned blobIds in the attachmentIds field.
put/api/v1.0/draft/

Request body

messageIdstring uuid nullable

Message ID if updating an existing draft

parentIdstring uuid nullable

Message ID if replying to an existing message

senderIdstring uuid required

Mailbox ID to use as sender

subjectstring nullable

Subject of the message (optional; empty or null allowed)

draftBodystring

Content of the draft message as arbitrary text (usually JSON)

tostring[]

List of recipient email addresses

ccstring[]

List of CC recipient email addresses

bccstring[]

List of BCC recipient email addresses

attachmentsobject[]

List of attachment objects with blobId, partId, and name

signatureIdstring uuid nullable

ID of the signature template to use

Response

idstring uuid required

primary key for the record as UUID

parent_idstring uuid nullable required
thread_idstring uuid nullable required
subjectstring nullable required
created_atstring date-time required

date and time at which a record was created

updated_atstring date-time required

date and time at which a record was last updated

draftBodystring nullable required
sent_atstring date-time nullable required
is_senderboolean required
is_draftboolean required
is_unreadboolean required
is_trashedboolean required
is_archivedboolean required
has_attachmentsboolean required
mime_idstring nullable required
stmsg_headersobject required

Return the STMSG headers of the message.

snippetstring required

Changes

Changed in 16 of the 54 revisions of this API.341256

  • ba0c140b76dd86See the full diff
    • the bcc/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 200

      response-property-type-changed

    • the bcc/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 201

      response-property-type-changed

    • the cc/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 200

      response-property-type-changed

    • the cc/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 201

      response-property-type-changed

    • the sender/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 200

      response-property-type-changed

    • the sender/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 201

      response-property-type-changed

    • the to/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 200

      response-property-type-changed

    • the to/items/contact/allOf[Contact]/email response's property type/format changed from string/email to string/ for status 201

      response-property-type-changed

    • the bcc/items/ request property type/format was generalized from string/email to string/ (media type: application/json)

      request-property-type-generalized

    • the bcc/items/ request property type/format was generalized from string/email to string/ (media type: multipart/form-data)

      request-property-type-generalized

    • the cc/items/ request property type/format was generalized from string/email to string/ (media type: application/json)

      request-property-type-generalized

    • the cc/items/ request property type/format was generalized from string/email to string/ (media type: multipart/form-data)

      request-property-type-generalized

    • the to/items/ request property type/format was generalized from string/email to string/ (media type: application/json)

      request-property-type-generalized

    • the to/items/ request property type/format was generalized from string/email to string/ (media type: multipart/form-data)

      request-property-type-generalized

    • added the required property snippet to the response with the 200 status

      response-required-property-added

    • added the required property snippet to the response with the 201 status

      response-required-property-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the required property mime_id to the response with the 200 status

      response-required-property-added

    • added the required property mime_id to the response with the 201 status

      response-required-property-added

  • 00a56b21a28b26See the full diff
    • added the new autoreply enum value to the signature/allOf[ReadMessageTemplate]/type response property for the response status 200

      response-property-enum-value-added

    • added the new autoreply enum value to the signature/allOf[ReadMessageTemplate]/type response property for the response status 201

      response-property-enum-value-added

    • added the optional property signature/allOf[ReadMessageTemplate]/metadata to the response with the 200 status

      response-optional-property-added

    • added the optional property signature/allOf[ReadMessageTemplate]/metadata to the response with the 201 status

      response-optional-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply to the response with the 200 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply to the response with the 201 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/signature to the response with the 200 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/signature to the response with the 201 status

      response-required-property-added

  • a5dc72b4835b422See the full diff
    • removed the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply from the response with the 200 status

      response-required-property-removed

    • removed the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply from the response with the 201 status

      response-required-property-removed

    • removed the required property signature/allOf[ReadMessageTemplate]/signature from the response with the 200 status

      response-required-property-removed

    • removed the required property signature/allOf[ReadMessageTemplate]/signature from the response with the 201 status

      response-required-property-removed

    • removed the optional property signature/allOf[ReadMessageTemplate]/metadata from the response with the 200 status

      response-optional-property-removed

    • removed the optional property signature/allOf[ReadMessageTemplate]/metadata from the response with the 201 status

      response-optional-property-removed

    • removed the autoreply enum value from the signature/allOf[ReadMessageTemplate]/type response property for the response status 200

      response-property-enum-value-removed

    • removed the autoreply enum value from the signature/allOf[ReadMessageTemplate]/type response property for the response status 201

      response-property-enum-value-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new autoreply enum value to the signature/allOf[ReadMessageTemplate]/type response property for the response status 200

      response-property-enum-value-added

    • added the new autoreply enum value to the signature/allOf[ReadMessageTemplate]/type response property for the response status 201

      response-property-enum-value-added

    • added the optional property signature/allOf[ReadMessageTemplate]/metadata to the response with the 200 status

      response-optional-property-added

    • added the optional property signature/allOf[ReadMessageTemplate]/metadata to the response with the 201 status

      response-optional-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply to the response with the 200 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/is_active_autoreply to the response with the 201 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/signature to the response with the 200 status

      response-required-property-added

    • added the required property signature/allOf[ReadMessageTemplate]/signature to the response with the 201 status

      response-required-property-added

    • removed the required property is_starred from the response with the 200 status

      response-required-property-removed

    • removed the required property is_starred from the response with the 201 status

      response-required-property-removed

    • removed the required property read_at from the response with the 200 status

      response-required-property-removed

    • removed the required property read_at from the response with the 201 status

      response-required-property-removed

    • added the required property sender_user to the response with the 200 status

      response-required-property-added

    • added the required property sender_user to the response with the 201 status

      response-required-property-added

    • removed the required property sender_user from the response with the 200 status

      response-required-property-removed

    • removed the required property sender_user from the response with the 201 status

      response-required-property-removed

    • added the required property read_at to the response with the 200 status

      response-required-property-added

    • added the required property read_at to the response with the 201 status

      response-required-property-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 575958bae45922See the full diff
    • removed the required property read_at from the response with the 200 status

      response-required-property-removed

    • removed the required property read_at from the response with the 201 status

      response-required-property-removed

    • added the required property sender_user to the response with the 200 status

      response-required-property-added

    • added the required property sender_user to the response with the 201 status

      response-required-property-added