Skip to content

Change a mailing draft

On this page
PATCH/v1/mailings/{mailing_id}update_mailing_draft
Riskwrite
AuthenticationAPI key or OAuth access token
Scopesmailings:write
Idempotencysupported: send an Idempotency-Key header to make retries safe
Dry runyes: add dry_run=true to the query
Success status200
Response typeapplication/json

What it does#

  • Use when: You edit a draft: send only the fields that change, with If-Match set to the ETag you last read.
  • Do not use when: the mailing is scheduled, sending or sent (only drafts can change).
  • Side effects: Replaces the draft's stored fields and bumps its revision.
  • Reversible: Yes, call update_mailing_draft again.
  • Required scope: mailings:write.
  • Idempotency: supported (Idempotency-Key header).
  • Typical next step: fix the problems in render, then call preview_send.

Scopes#

  • mailings:write: Create, edit and delete draft mailings, and ask for a send to be approved.

Side effects#

  • Replaces the draft's stored fields and bumps its revision

Concurrency#

Send the revision you last read in an If-Match header. A stale revision returns revision_mismatch (HTTP 412) with the current revision.

Request#

Path parameters#

FieldTypeDescription
mailing_idstring

Query parameters#

None.

Every mutation also accepts dry_run=true: it runs every check and returns {"dry_run": true, "would": {...}} without writing anything.

Body (application/json)#

FieldTypeRequiredDescription
subjectstring, max 200 charactersno
from_namestring, max 100 charactersno
sending_domain_idstring or nullno
from_localstringno
audienceobjectno
audience.list_idsarray of string, max 50 items or nullnonull or omitted means all subscribers
audience.tagstring, max 200 charactersno
simpleobjectno
simple.starter_idstring, max 41 characters, default "blank"no
simple.skin_idstring, max 40 characters, default "neutral"no
simple.preheaderstring, max 150 charactersno
simple.factsobjectno
simple.facts.author_namestring, max 70 charactersnoThe name in the masthead and the signature. The workspace sender_name (get_workspace) is usually the right value. Without it the starter shows an example name and the mailing cannot be sent.
simple.facts.logo_urlstring, max 2048 charactersno
simple.facts.portrait_urlstring, max 2048 charactersno
simple.facts.bookobjectno
simple.sectionsarray of object, max 30 items, default []noBody sections in order. Each is an object whose type is one of heading, paragraph, image, button, book, divider, with these fields: heading: text (required), level (default 2), eyebrow; paragraph: text (required); image: src (required), alt (default ""), decorative, href, caption; button: label (required), href (required), width (default "auto"); book: title (required), blurb, cover_url, series, series_number, release_date, button_label (default "Get the book"), href (required), badge; divider: style (default "rule"). Leave sections out to keep the starter's own body, which still has example text until you replace it.
simple.sections[type=heading].textstring, max 160 charactersyes
simple.sections[type=heading].levelone of 1, 2, 3, default 2no
simple.sections[type=heading].eyebrowstring, max 60 charactersno
simple.sections[type=paragraph].textstring, max 8000 charactersyesPlain text. A blank line starts a new paragraph. Allowed inline marks: bold, _italic_, label. Merge fields look like {{first_name|there}} and are never allowed inside a link address.
simple.sections[type=image].srcstring, max 2048 charactersyesAn https address, or an address returned by upload_mailing_image
simple.sections[type=image].altstring, max 200 characters, default ""no
simple.sections[type=image].decorativebooleanno
simple.sections[type=image].hrefstring, max 2048 charactersno
simple.sections[type=image].captionstring, max 200 charactersno
simple.sections[type=button].labelstring, max 40 charactersyes
simple.sections[type=button].hrefstring, max 2048 charactersyes
simple.sections[type=button].widthone of "auto", "full", default "auto"no
simple.sections[type=book].titlestring, max 120 charactersyes
simple.sections[type=book].blurbstring, max 2000 charactersno
simple.sections[type=book].cover_urlstring, max 2048 charactersno
simple.sections[type=book].seriesstring, max 120 charactersno
simple.sections[type=book].series_numberstring, max 20 charactersno
simple.sections[type=book].release_datestring, max 40 charactersno
simple.sections[type=book].button_labelstring, max 40 characters, default "Get the book"no
simple.sections[type=book].hrefstring, max 2048 charactersyes
simple.sections[type=book].badgestring, max 30 charactersno
simple.sections[type=divider].styleone of "rule", "ornament", "dots", "space", default "rule"no
designobjectno

Response#

FieldTypeRequiredDescription
idstringyes
statusone of "draft", "scheduled", "requires_approval", "sending", "sent", "paused", "failed"yes
subjectstringyes
from_namestringyes
from_emailstringyes
uses_platform_senderbooleanyes
revisioninteger, min -9007199254740991, max 9007199254740991yes
audienceobjectyes
audience.descriptionstring or nullyes
audience.list_idsarray of string or nullyes
audience.tagstring or nullyes
scheduled_atstring (date-time) or nullyes
sent_atstring (date-time) or nullyes
created_atstring (date-time)yes
updated_atstring (date-time)yes
total_recipientsinteger, min -9007199254740991, max 9007199254740991yesReaders the send was planned for. It is 0 on a draft because the audience is only counted when the send is planned. Call preview_send for the recipient count of a draft.
hold_reasonsarray of objectyes
hold_reasons[].codestringyes
hold_reasons[].messagestringyes
dashboard_urlstringyesWhere the author opens the mailing. Use the value from the response: the host belongs to the environment you are calling.
editablebooleanyes
htmlstringnoOnly with fields=html
renderobjectyesThe render of the stored content: byte size against the 90 KiB cap, and every problem with a fix.
render.htmlstringyes
render.textstringyes
render.bytesinteger, min -9007199254740991, max 9007199254740991yes
render.max_bytesinteger, min -9007199254740991, max 9007199254740991yes
render.sendablebooleanyesFalse while any error-severity problem remains
render.problemsarray of objectyes
render.problems[].severityone of "error", "warning"yes
render.problems[].codestringyes
render.problems[].messagestringyes
render.problems[].block_idstringno
render.problems[].fieldstringnoThe request field to change, for example simple.facts.author_name, when the problem comes from something you sent
render.problems[].fixstringyesOne imperative sentence: what to change

Examples#

new subject#

Request:

curl -X PATCH 'https://api.seemly.com/v1/mailings/cmp_2c4e6g8j0m2p4r6t8w0y2a4c' \
  -H "Authorization: Bearer $SEEMLY_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Content-Type: application/json" \
  -d '{
  "subject": "Chapter two is up"
}'

Response: 200:

JSON
{
  "id": "cmp_2c4e6g8j0m2p4r6t8w0y2a4c",
  "status": "draft",
  "subject": "Chapter two is up",
  "from_name": "Hollow Oak Books",
  "from_email": "[email protected]",
  "uses_platform_sender": true,
  "revision": 2,
  "audience": {
    "description": null,
    "list_ids": null,
    "tag": null
  },
  "scheduled_at": null,
  "sent_at": null,
  "created_at": "2026-12-02T09:30:00Z",
  "updated_at": "2026-12-02T09:30:00Z",
  "total_recipients": 0,
  "hold_reasons": [],
  "dashboard_url": "https://app.seemly.com/dashboard/campaigns/cmp_2c4e6g8j0m2p4r6t8w0y2a4c",
  "editable": true,
  "render": {
    "html": "<!doctype html><html><body><p>Hello</p></body></html>",
    "text": "Hello",
    "bytes": 52,
    "max_bytes": 92160,
    "sendable": true,
    "problems": []
  }
}

Errors#

Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.

Typical next steps#

View this page as MarkdownReport a problem with this page

Type to search. Try a method and path, an operation name or an error code.