# update_mailing_draft

Change a mailing draft

`PATCH /v1/mailings/{mailing_id}`

| | |
| --- | --- |
| Risk | write |
| Authentication | API key or OAuth access token |
| Scopes | `mailings:write` |
| Idempotency | supported: send an Idempotency-Key header to make retries safe |
| Dry run | yes: add dry_run=true to the query |
| Success status | 200 |
| Response type | application/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

| Field | Type | Description |
| --- | --- | --- |
| `mailing_id` | string |  |

### 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)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `subject` | string, max 200 characters | no |  |
| `from_name` | string, max 100 characters | no |  |
| `sending_domain_id` | string or null | no |  |
| `from_local` | string | no |  |
| `audience` | object | no |  |
| `audience.list_ids` | array of string, max 50 items or null | no | null or omitted means all subscribers |
| `audience.tag` | string, max 200 characters | no |  |
| `simple` | object | no |  |
| `simple.starter_id` | string, max 41 characters, default "blank" | no |  |
| `simple.skin_id` | string, max 40 characters, default "neutral" | no |  |
| `simple.preheader` | string, max 150 characters | no |  |
| `simple.facts` | object | no |  |
| `simple.facts.author_name` | string, max 70 characters | no | The 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_url` | string, max 2048 characters | no |  |
| `simple.facts.portrait_url` | string, max 2048 characters | no |  |
| `simple.facts.book` | object | no |  |
| `simple.sections` | array of object, max 30 items, default [] | no | Body 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].text` | string, max 160 characters | yes |  |
| `simple.sections[type=heading].level` | one of 1, 2, 3, default 2 | no |  |
| `simple.sections[type=heading].eyebrow` | string, max 60 characters | no |  |
| `simple.sections[type=paragraph].text` | string, max 8000 characters | yes | Plain text. A blank line starts a new paragraph. Allowed inline marks: **bold**, _italic_, [label](https://link). Merge fields look like {{first_name\|there}} and are never allowed inside a link address. |
| `simple.sections[type=image].src` | string, max 2048 characters | yes | An https address, or an address returned by upload_mailing_image |
| `simple.sections[type=image].alt` | string, max 200 characters, default "" | no |  |
| `simple.sections[type=image].decorative` | boolean | no |  |
| `simple.sections[type=image].href` | string, max 2048 characters | no |  |
| `simple.sections[type=image].caption` | string, max 200 characters | no |  |
| `simple.sections[type=button].label` | string, max 40 characters | yes |  |
| `simple.sections[type=button].href` | string, max 2048 characters | yes |  |
| `simple.sections[type=button].width` | one of "auto", "full", default "auto" | no |  |
| `simple.sections[type=book].title` | string, max 120 characters | yes |  |
| `simple.sections[type=book].blurb` | string, max 2000 characters | no |  |
| `simple.sections[type=book].cover_url` | string, max 2048 characters | no |  |
| `simple.sections[type=book].series` | string, max 120 characters | no |  |
| `simple.sections[type=book].series_number` | string, max 20 characters | no |  |
| `simple.sections[type=book].release_date` | string, max 40 characters | no |  |
| `simple.sections[type=book].button_label` | string, max 40 characters, default "Get the book" | no |  |
| `simple.sections[type=book].href` | string, max 2048 characters | yes |  |
| `simple.sections[type=book].badge` | string, max 30 characters | no |  |
| `simple.sections[type=divider].style` | one of "rule", "ornament", "dots", "space", default "rule" | no |  |
| `design` | object | no |  |

## Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `status` | one of "draft", "scheduled", "requires_approval", "sending", "sent", "paused", "failed" | yes |  |
| `subject` | string | yes |  |
| `from_name` | string | yes |  |
| `from_email` | string | yes |  |
| `uses_platform_sender` | boolean | yes |  |
| `revision` | integer, min -9007199254740991, max 9007199254740991 | yes |  |
| `audience` | object | yes |  |
| `audience.description` | string or null | yes |  |
| `audience.list_ids` | array of string or null | yes |  |
| `audience.tag` | string or null | yes |  |
| `scheduled_at` | string (date-time) or null | yes |  |
| `sent_at` | string (date-time) or null | yes |  |
| `created_at` | string (date-time) | yes |  |
| `updated_at` | string (date-time) | yes |  |
| `total_recipients` | integer, min -9007199254740991, max 9007199254740991 | yes | Readers 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_reasons` | array of object | yes |  |
| `hold_reasons[].code` | string | yes |  |
| `hold_reasons[].message` | string | yes |  |
| `dashboard_url` | string | yes | Where the author opens the mailing. Use the value from the response: the host belongs to the environment you are calling. |
| `editable` | boolean | yes |  |
| `html` | string | no | Only with fields=html |
| `render` | object | yes | The render of the stored content: byte size against the 90 KiB cap, and every problem with a fix. |
| `render.html` | string | yes |  |
| `render.text` | string | yes |  |
| `render.bytes` | integer, min -9007199254740991, max 9007199254740991 | yes |  |
| `render.max_bytes` | integer, min -9007199254740991, max 9007199254740991 | yes |  |
| `render.sendable` | boolean | yes | False while any error-severity problem remains |
| `render.problems` | array of object | yes |  |
| `render.problems[].severity` | one of "error", "warning" | yes |  |
| `render.problems[].code` | string | yes |  |
| `render.problems[].message` | string | yes |  |
| `render.problems[].block_id` | string | no |  |
| `render.problems[].field` | string | no | The request field to change, for example simple.facts.author_name, when the problem comes from something you sent |
| `render.problems[].fix` | string | yes | One imperative sentence: what to change |

## Examples

### new subject

Request:

```bash
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": "hollow-oak@mail.seemly.com",
  "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

| Status | Codes |
| --- | --- |
| 400 | [`validation_failed`](/developers/md/errors/validation_failed) |
| 401 | [`unauthenticated`](/developers/md/errors/unauthenticated), [`credential_revoked`](/developers/md/errors/credential_revoked), [`credential_expired`](/developers/md/errors/credential_expired) |
| 403 | [`insufficient_scope`](/developers/md/errors/insufficient_scope), [`plan_does_not_include`](/developers/md/errors/plan_does_not_include), [`workspace_paused`](/developers/md/errors/workspace_paused), [`api_suspended`](/developers/md/errors/api_suspended), [`consent_required`](/developers/md/errors/consent_required) |
| 404 | [`not_found`](/developers/md/errors/not_found) |
| 409 | [`conflict`](/developers/md/errors/conflict), [`idempotency_key_reused`](/developers/md/errors/idempotency_key_reused), [`request_in_progress`](/developers/md/errors/request_in_progress) |
| 412 | [`revision_mismatch`](/developers/md/errors/revision_mismatch) |
| 413 | [`payload_too_large`](/developers/md/errors/payload_too_large) |
| 415 | [`unsupported_media_type`](/developers/md/errors/unsupported_media_type) |
| 429 | [`rate_limited`](/developers/md/errors/rate_limited), [`quota_exceeded`](/developers/md/errors/quota_exceeded) |
| 503 | [`service_unavailable`](/developers/md/errors/service_unavailable) |

Every error is an `application/problem+json` body with a `code`, a `fix` sentence and `next_actions`. See [reading a problem response](/developers/md/guides/agents#reading-a-problem-response).

## Typical next steps

- [`render_mailing`](/developers/md/operations/render_mailing)
- [`preview_send`](/developers/md/operations/preview_send)

## Related

- [OpenAPI document](https://api.seemly.com/v1/openapi.json)
- [Agent guide](/developers/md/guides/agents)
