Mailboxes
Messages

Update an inbox reply draft

Replace the body of a reply draft in status draft. The new body replaces the old one: html alone derives the text part; text alone makes a plain-text draft. Recipients, subject and reply headers stay derived from the source message, and the draft ID stays the same. Returns 409 conflict when the status is not draft, when the thread changed since expected_version (the draft becomes invalidated; create a new draft from a fresh thread read), when the draft changed concurrently, or when the draft belongs to the Shipmail Assistant. Returns 422 when html keeps no text or image and no text is given. 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.

patch/mailboxes/{id}/inbox/threads/{thread_id}/drafts/{draft_id}

Request

  • Base URL: https://shipmail.to/api/v1
  • URL: https://shipmail.to/api/v1/mailboxes/{id}/inbox/threads/{thread_id}/drafts/{draft_id}
  • 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

Updated reply draft.

object'inbox_reply_draft' required
idstring required
mailbox_idstring required
thread_idstring required

Deprecated and not stable: a legacy thread ID that changes when the mail server re-threads its IDs or a relayed send's placeholder key is replaced. It remains supported in thread paths; store conversation_id instead.

conversation_idstring required

Stable Shipmail conversation identifier (thd_...). Store this: it survives thread merges and mail-server re-threading, which thread_id does not.

based_on_message_idstring nullable required
expected_versioninteger required
reply_mode'reply' | 'reply_all' required
status'draft' | 'sending' | 'sent' | 'invalidated' | 'failed' required
subjectstring nullable required

Stored subject. Null once the stored draft no longer exists (after a send or cleanup).

htmlstring nullable required

Stored HTML after sanitisation. Null once the stored draft no longer exists.

textstring nullable required

Stored text part. Null once the stored draft no longer exists.

sent_message_idstring nullable required

ID of the sent message once the draft is sent.

created_atstring date-time required
updated_atstring date-time required
sent_atstring date-time nullable 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.

Changes

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