Mailboxes
Messages

Save a new message draft

Save a new message (not a reply) to the mailbox's Drafts folder for a person to review, edit, and send from Shipmail or any mail client. Nothing is sent, and there is no endpoint to send it. The returned id is an inbox message ID, so the draft can be read or deleted with the inbox message endpoints. Recipients must be allowed by the API key's recipient limits. The response lists in removed_formatting any formatting the HTML sanitiser dropped. Supported HTML tags: p, br, strong/b, em/i, u, s, a (http, https, mailto, tel), ul, ol, li, blockquote, code, pre, h2, h3, span/mark with the composer's styles, and inline cid: images. h1 becomes h2. Tables and h4-h6 are not supported: their text stays as paragraphs and removed_formatting lists them ("table" for any table part, "h4", ...), as it lists other dropped elements such as script, style or iframe. Attributes and inline styles outside the composer set are dropped and not reported. Paragraphs are spaced like the Shipmail composer, so do not add <p><br></p> between them. When html is given without text, the text part is derived from it.

post/mailboxes/{id}/inbox/drafts

Request

  • Base URL: https://shipmail.to/api/v1
  • URL: https://shipmail.to/api/v1/mailboxes/{id}/inbox/drafts
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://shipmail.to/api/auth/oauth2/authorize, token URL https://shipmail.to/api/auth/oauth2/token)

Headers

X-Shipmail-Organizationstring

OAuth access tokens only. The organization ID this request acts on. Required when the OAuth connection was approved for several organizations (400 validation_error without it); optional with one. An organization the connection was not approved for returns 403 authorization_error. Ignored for API keys, which belong to one organization.

Request body

OR

Response

Draft saved to the Drafts folder.

object'inbox_draft' required
idstring required

Inbox message ID of the saved draft. Read it with GET /mailboxes/{id}/inbox/messages/{message_id}.

mailbox_idstring required
subjectstring required
removed_formattingstring[] required

Formatting the HTML sanitiser dropped: "table" for any table part, "h4" to "h6", and other dropped elements such as "script". Their text stays as paragraphs. Empty when nothing was dropped.

created_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.