---
title: "Update an email message"
method: POST
path: "/v1/email-messages/{emailMessageId}"
tags: ["Email messages"]
---

# Update an email message

`POST /v1/email-messages/{emailMessageId}`

Update fields on an email message (subject, preview text, sender, LMX content). The campaign must be in draft status. Supply `expectedRevisionId` matching the current `contentRevisionId` — the server rejects mismatched revisions with 409.

## Request body

- UpdateEmailMessageRequest
  - `expectedRevisionId` string — The `contentRevisionId` you last fetched, or the `emailMessageContentRevisionId` you received when creating the campaign.
  - `subject` string
  - `previewText` string
  - `fromName` string
  - `fromEmail` string — The email sender email address, without the team's sending domain.
  - `replyToEmail` string — Reply-to email. Must be empty or a valid email address.
  - `ccEmail` string — CC email address. Requires the team to have CC/BCC enabled.
  - `bccEmail` string — BCC email address. Requires the team to have CC/BCC enabled.
  - `languageCode` string — ISO 639-1 language code for the email, e.g. `en` or `fr`.
  - `emailFormat` 'styled' | 'plain' — The rendering format of the email.
  - `lmx` string — The email body serialized as LMX. Styles must be embedded in the LMX `<Style />` tag.
  - `contactPropertiesFallbacks` object — Fallback values for contact properties, keyed by property name. Per-key merge: a string value sets the fallback, a null value deletes it, and keys omitted from the map are left unchanged.
  - `eventPropertiesFallbacks` object — Fallback values for event properties, keyed by property name. Per-key merge: a string value sets the fallback, a null value deletes it, and keys omitted from the map are left unchanged.
  - `dataVariablesFallbacks` object — Fallback values for data variables, keyed by variable name. Per-key merge: a string value sets the fallback, a null value deletes it, and keys omitted from the map are left unchanged.

## Response `200`

Email message updated.

- EmailMessageResponse
  - `id` string, required — The ID of the email message.
  - `campaignId` string — The campaign this email message belongs to. Present only when the message belongs to a campaign (mutually exclusive with `transactionalId`).
  - `transactionalId` string — The transactional email this email message belongs to. Present only when the message belongs to a transactional email (mutually exclusive with `campaignId`).
  - `subject` string, required — The email subject.
  - `previewText` string, required — The email preview text.
  - `fromName` string, required — The email sender name.
  - `fromEmail` string, required — The email sender email address, without the team's sending domain.
  - `replyToEmail` string, required — The email reply-to address.
  - `ccEmail` string — The email CC address. Only present when set.
  - `bccEmail` string — The email BCC address. Only present when set.
  - `languageCode` string — ISO 639-1 language code for the email, e.g. `en` or `fr`. Only present when set.
  - `emailFormat` 'styled' | 'plain', required — The rendering format of the email.
  - `lmx` string, required — The email body serialized as LMX.
  - `contentRevisionId` string, nullable, required — The current content revision. Pass this as `expectedRevisionId` on your next update.
  - `updatedAt` string, date-time, required
  - `contactPropertiesFallbacks` object — Fallback values for contact properties. Only present when set.
  - `eventPropertiesFallbacks` object — Fallback values for event properties. Only present when set.
  - `dataVariablesFallbacks` object — Fallback values for data variables. Only present when set.
  - `warnings` object[] — Non-fatal issues raised while compiling the submitted LMX. Only present on update responses when warnings were produced.
    - `rule` string, required
    - `severity` 'warning', required
    - `message` string, required
    - `path` string

## Other responses

- `400` — Invalid request body.
- `401` — Invalid API key or content API not enabled for this team.
- `404` — Email message not found.
- `405` — Wrong HTTP request method.
- `409` — Campaign is not in draft status, `contentRevisionId` is stale, content cannot be parsed, or email message uses MJML format.
- `413` — LMX payload exceeds the 100KB limit.
- `422` — LMX failed to compile.

---

[API](https://skmtc.net/loops/apis/loops-openapi-spec.md) · [All operations](https://skmtc.net/loops/apis/loops-openapi-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loops/loops-openapi-spec/versions/96c4b50b8b95/schema)
