> ## 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 an email message's subject, preview text, sender, or LMX content.

Supply `expectedRevisionId` matching the current `contentRevisionId`.

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


## OpenAPI

````yaml https://app.loops.so/openapi.json post /v1/email-messages/{emailMessageId}
openapi: 3.1.0
info:
  title: Loops OpenAPI Spec
  description: This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api).
  version: 1.21.6
servers:
  - url: https://app.loops.so/api
security: []
tags:
  - name: API key
  - name: Audience segments
    description: View audience segments
  - name: Campaigns
    description: Create and manage email campaigns
  - name: Campaign groups
    description: Organize campaigns into groups
  - name: Configuration
    description: View configuration settings
  - name: Contacts
    description: Manage contacts in your audience
  - name: Contact properties
    description: Manage contact properties
  - name: Components
    description: View email components
  - name: Email messages
    description: Manage email message content for campaigns
  - name: Events
    description: Trigger workflows with events
  - name: Event patterns
    description: View workflow event patterns
  - name: Mailing lists
    description: View mailing lists
  - name: Themes
    description: View email themes
  - name: Transactional emails
    description: Create, manage, and send transactional emails
  - name: Transactional groups
    description: Organize transactional emails into groups
  - name: Uploads
    description: Upload image assets
  - name: Workflows
    description: View and mutate workflow graphs
  - name: Workflow nodes
    description: View and mutate workflow nodes
  - name: Webhooks
    description: >-
      Events Loops sends to your configured webhook endpoint when certain events
      happen in your account. Configure an endpoint in Settings → Webhooks. Each
      account supports one webhook endpoint. Events are signed with
      `webhook-id`, `webhook-timestamp`, and `webhook-signature` headers and
      delivered at a maximum rate of 10 per second. See
      https://loops.so/docs/webhooks for setup, verification, and payload
      details.
paths:
  /v1/email-messages/{emailMessageId}:
    parameters:
      - name: emailMessageId
        in: path
        required: true
        description: The ID of the email message.
        schema:
          type: string
          examples:
            - cle5f7g9h1i3j5k7l9m1n3p5
    post:
      tags:
        - Email messages
      summary: Update an email message
      description: >-
        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.
      operationId: updateEmailMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmailMessageRequest'
      responses:
        '200':
          description: Email message updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageResponse'
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageFailureResponse'
        '401':
          description: Invalid API key or content API not enabled for this team.
        '404':
          description: Email message not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageFailureResponse'
        '405':
          description: Wrong HTTP request method.
        '409':
          description: >-
            Campaign is not in draft status, `contentRevisionId` is stale,
            content cannot be parsed, or email message uses MJML format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageFailureResponse'
        '413':
          description: LMX payload exceeds the 100KB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageFailureResponse'
        '422':
          description: LMX failed to compile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailMessageFailureResponse'
      security:
        - apiKey: []
components:
  schemas:
    UpdateEmailMessageRequest:
      type: object
      properties:
        expectedRevisionId:
          type: string
          description: >-
            The `contentRevisionId` you last fetched, or the
            `emailMessageContentRevisionId` you received when creating the
            campaign.
        subject:
          type: string
        previewText:
          type: string
        fromName:
          type: string
        fromEmail:
          type: string
          description: The email sender email address, without the team's sending domain.
          examples:
            - hello
        replyToEmail:
          type: string
          description: Reply-to email. Must be empty or a valid email address.
        ccEmail:
          type: string
          description: CC email address. Requires the team to have CC/BCC enabled.
        bccEmail:
          type: string
          description: BCC email address. Requires the team to have CC/BCC enabled.
        languageCode:
          type: string
          description: ISO 639-1 language code for the email, e.g. `en` or `fr`.
        emailFormat:
          type: string
          enum:
            - styled
            - plain
          description: The rendering format of the email.
        lmx:
          type: string
          description: >-
            The email body serialized as LMX. Styles must be embedded in the LMX
            `<Style />` tag.
        contactPropertiesFallbacks:
          type: object
          description: >-
            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.
          additionalProperties:
            type:
              - string
              - 'null'
        eventPropertiesFallbacks:
          type: object
          description: >-
            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.
          additionalProperties:
            type:
              - string
              - 'null'
        dataVariablesFallbacks:
          type: object
          description: >-
            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.
          additionalProperties:
            type:
              - string
              - 'null'
      additionalProperties: false
      examples:
        - expectedRevisionId: clrev1s10n2i3d4e5f6g7h8
          subject: Spring product updates
          previewText: See what's new this season
          fromName: Acme Team
          fromEmail: hello
          replyToEmail: support@company.com
          emailFormat: styled
          lmx: <Paragraph>Hello, {firstName}!</Paragraph>
          contactPropertiesFallbacks:
            firstName: there
    EmailMessageResponse:
      type: object
      properties:
        id:
          type: string
          examples:
            - cle5f7g9h1i3j5k7l9m1n3p5
          description: The ID of the email message.
        campaignId:
          type: string
          description: >-
            The campaign this email message belongs to. Present only when the
            message belongs to a campaign (mutually exclusive with
            `transactionalId`).
          examples:
            - clc4m6n8p0q2r4s6t8u0v2x4
        transactionalId:
          type: string
          description: >-
            The transactional email this email message belongs to. Present only
            when the message belongs to a transactional email (mutually
            exclusive with `campaignId`).
        subject:
          type: string
          description: The email subject.
          examples:
            - Spring product updates
        previewText:
          type: string
          description: The email preview text.
          examples:
            - See what's new this season
        fromName:
          type: string
          description: The email sender name.
          examples:
            - Acme Team
        fromEmail:
          type: string
          description: The email sender email address, without the team's sending domain.
          examples:
            - hello
        replyToEmail:
          type: string
          description: The email reply-to address.
          examples:
            - support@company.com
        ccEmail:
          type: string
          description: The email CC address. Only present when set.
        bccEmail:
          type: string
          description: The email BCC address. Only present when set.
        languageCode:
          type: string
          description: >-
            ISO 639-1 language code for the email, e.g. `en` or `fr`. Only
            present when set.
        emailFormat:
          type: string
          enum:
            - styled
            - plain
          description: The rendering format of the email.
          examples:
            - styled
        lmx:
          type: string
          description: The email body serialized as LMX.
          examples:
            - <Paragraph>Hello, {firstName}!</Paragraph>
        contentRevisionId:
          type:
            - string
            - 'null'
          description: >-
            The current content revision. Pass this as `expectedRevisionId` on
            your next update.
          examples:
            - clrev1s10n2i3d4e5f6g7h8
        updatedAt:
          type: string
          format: date-time
          examples:
            - '2025-06-29T07:47:39.370Z'
        contactPropertiesFallbacks:
          type: object
          description: Fallback values for contact properties. Only present when set.
          additionalProperties:
            type: string
        eventPropertiesFallbacks:
          type: object
          description: Fallback values for event properties. Only present when set.
          additionalProperties:
            type: string
        dataVariablesFallbacks:
          type: object
          description: Fallback values for data variables. Only present when set.
          additionalProperties:
            type: string
        warnings:
          type: array
          description: >-
            Non-fatal issues raised while compiling the submitted LMX. Only
            present on update responses when warnings were produced.
          items:
            type: object
            properties:
              rule:
                type: string
              severity:
                type: string
                enum:
                  - warning
              message:
                type: string
              path:
                type: string
            required:
              - rule
              - severity
              - message
      required:
        - id
        - subject
        - previewText
        - fromName
        - fromEmail
        - replyToEmail
        - emailFormat
        - lmx
        - contentRevisionId
        - updatedAt
      examples:
        - id: cle5f7g9h1i3j5k7l9m1n3p5
          campaignId: clc4m6n8p0q2r4s6t8u0v2x4
          subject: Spring product updates
          previewText: See what's new this season
          fromName: Acme Team
          fromEmail: hello
          replyToEmail: support@company.com
          emailFormat: styled
          lmx: <Paragraph>Hello, {firstName}!</Paragraph>
          contentRevisionId: clrev1s10n2i3d4e5f6g7h8
          updatedAt: '2025-06-29T07:47:39.370Z'
    EmailMessageFailureResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      examples:
        - message: Email message not found.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

## Related topics

- [Workflows API examples](/docs/api-reference/examples/workflows.md)
- [LMX](/docs/creating-emails/lmx.md)
- [Create a campaign](/docs/api-reference/create-campaign.md)
- [Supabase - Send emails](/docs/integrations/supabase/send-email.md)
- [API Introduction](/docs/api-reference/intro.md)
