> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an email message

> Update fields on an email message.

<Warning>
  Content API endpoints are currently in an open alpha and are subject to
  change.
</Warning>

## Request

<Info>
  The campaign that owns this email message must be in `Draft` status.
</Info>

### Path parameters

<ParamField path="emailMessageId" type="string" required>
  The ID of the email message.
</ParamField>

### Body

<ParamField body="expectedRevisionId" type="string">
  The `contentRevisionId` you last fetched, or the `emailMessageContentRevisionId` you received when creating the campaign. Used for optimistic concurrency.
</ParamField>

<ParamField body="subject" type="string">
  Email subject line.
</ParamField>

<ParamField body="previewText" type="string">
  Email preview text.
</ParamField>

<ParamField body="fromName" type="string">
  Sender display name.
</ParamField>

<ParamField body="fromEmail" type="string">
  The sender username (without `@` or domain). The team's sending domain is
  appended automatically.
</ParamField>

<ParamField body="replyToEmail" type="string">
  Reply-to email. Must be empty or a valid email address.
</ParamField>

<ParamField body="lmx" type="string">
  The email body serialized as [LMX](/creating-emails/lmx). Styles must be embedded in the LMX
  `<Style />` tag. The LMX payload must not exceed 100KB.
</ParamField>

## Response

### Success

<ResponseField name="success" type="boolean" required />

<ResponseField name="emailMessageId" type="string" required />

<ResponseField name="campaignId" type="nullable string" required />

<ResponseField name="subject" type="string" required />

<ResponseField name="previewText" type="string" required />

<ResponseField name="fromName" type="string" required />

<ResponseField name="fromEmail" type="string" required />

<ResponseField name="replyToEmail" type="string" required />

<ResponseField name="lmx" type="string" required />

<ResponseField name="contentRevisionId" type="nullable string" required>
  The current content revision ID. Use this value as `expectedRevisionId` on
  your next update request.
</ResponseField>

<ResponseField name="updatedAt" type="string" required />

<ResponseField name="warnings" type="object[]">
  Non-fatal issues raised while compiling the submitted LMX. Only present on update responses when warnings were produced.

  <Expandable title="warning object" defaultOpen={false}>
    <ResponseField name="rule" type="string" required />

    <ResponseField name="severity" type="string" required>
      Always `"warning"`.
    </ResponseField>

    <ResponseField name="message" type="string" required />

    <ResponseField name="path" type="string">
      Optional path for the warning location.
    </ResponseField>
  </Expandable>
</ResponseField>

### Error

If the request body is invalid, a `400 Bad Request` is returned.

A `404 Not Found` is returned if the email message does not exist.

A `409 Conflict` is returned when the campaign is not in draft status, when
`contentRevisionId` is stale, when content cannot be parsed, or when the email message uses MJML format.

A `413 Payload Too Large` is returned when the LMX payload exceeds the 100KB limit.

A `422 Unprocessable Entity` is returned when LMX compilation fails.

If the API key is invalid (or content API is not enabled for your team), a
`401 Unauthorized` is returned.

<ResponseField name="success" type="boolean" required />

<ResponseField name="message" type="string" required />

<ResponseExample>
  ```json Response theme={"dark"}
  {
    "success": true,
    "emailMessageId": "em_01hxyz",
    "campaignId": "cmp_01hxyz",
    "subject": "Big spring updates",
    "previewText": "A quick look at what's new",
    "fromName": "Loops",
    "fromEmail": "hello@news.example.com",
    "replyToEmail": "support@example.com",
    "lmx": "<Email><Text>Hello world</Text></Email>",
    "contentRevisionId": "rev_01hyza",
    "updatedAt": "2026-03-28T15:30:00.000Z"
  }
  ```

  ```json Error response theme={"dark"}
  {
    "success": false,
    "message": "An error message."
  }
  ```
</ResponseExample>
