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

# Publish a transactional email

> Publish the transactional email's current draft email message. The draft becomes the published version and the draft is cleared.

The transactional email's current draft email message is published. The draft becomes the published version and the draft is cleared.

After publishing, use the returned `id` as `transactionalId` with [Send a transactional email](https://loops.so/docs/api-reference/send-transactional-email.md) to send the email.


## OpenAPI

````yaml https://app.loops.so/openapi.json post /v1/transactional-emails/{transactionalId}/publish
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.23.0
servers:
  - url: https://app.loops.so/api
security: []
tags:
  - name: API key
  - name: Audience segments
    description: View and create 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 groups
    description: Organize workflows into groups
  - 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/transactional-emails/{transactionalId}/publish:
    parameters:
      - name: transactionalId
        in: path
        required: true
        description: The ID of the transactional email.
        schema:
          type: string
          examples:
            - cll42l54f20i1la0lfooe3z12
    post:
      tags:
        - Transactional emails
      summary: Publish a transactional email draft
      description: >-
        Publish the transactional email's current draft email message. The draft
        becomes the published version and the draft is cleared.
      operationId: publishTransactionalEmail
      responses:
        '200':
          description: Transactional email published.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalResource'
        '400':
          description: Invalid `transactionalId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalFailureResponse'
        '401':
          description: Invalid API key or content API not enabled for this team.
        '404':
          description: Transactional email not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalFailureResponse'
        '405':
          description: Wrong HTTP request method.
        '409':
          description: No draft to publish.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalFailureResponse'
        '422':
          description: >-
            Draft failed validation, sending domain is not verified, or content
            was flagged as unsafe.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalFailureResponse'
      security:
        - apiKey: []
components:
  schemas:
    TransactionalResource:
      type: object
      properties:
        id:
          type: string
          description: The ID of the transactional email.
          examples:
            - cll42l54f20i1la0lfooe3z12
        url:
          type: string
          format: uri
          description: The URL of the transactional email in the Loops app.
          examples:
            - https://app.loops.so/transactional/cll42l54f20i1la0lfooe3z12
        name:
          type: string
          description: The name of the transactional email.
          examples:
            - Sign up confirmation
        draftEmailMessageId:
          type:
            - string
            - 'null'
          description: >-
            The ID of the draft email message. `null` if there is no draft
            version.
          examples:
            - cle5f7g9h1i3j5k7l9m1n3p5
        publishedEmailMessageId:
          type:
            - string
            - 'null'
          description: >-
            The ID of the published email message. `null` if there is no
            published version.
          examples:
            - cle5f7g9h1i3j5k7l9m1n3p5
        transactionalGroupId:
          type:
            - string
            - 'null'
          description: The ID of the group this transactional email belongs to.
          examples:
            - clg7n5p3q1r9s7t5u3v1w9y7
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp for when the transactional email was created.
          examples:
            - '2025-06-29T07:47:39.370Z'
        updatedAt:
          type: string
          format: date-time
          description: >-
            ISO 8601 timestamp for when the transactional email was last
            updated.
          examples:
            - '2025-06-29T07:47:39.370Z'
        dataVariables:
          type: array
          description: >-
            Data variable names used by the published email. Empty for
            unpublished transactional emails.
          items:
            type: string
      required:
        - id
        - url
        - name
        - draftEmailMessageId
        - publishedEmailMessageId
        - transactionalGroupId
        - createdAt
        - updatedAt
        - dataVariables
      examples:
        - id: cll42l54f20i1la0lfooe3z12
          url: https://app.loops.so/transactional/cll42l54f20i1la0lfooe3z12
          name: Sign up confirmation
          draftEmailMessageId: cle5f7g9h1i3j5k7l9m1n3p5
          publishedEmailMessageId: cle5f7g9h1i3j5k7l9m1n3p5
          transactionalGroupId: clg7n5p3q1r9s7t5u3v1w9y7
          createdAt: '2025-06-29T07:47:39.370Z'
          updatedAt: '2025-06-29T07:47:39.370Z'
          dataVariables:
            - confirmationUrl
    TransactionalFailureResponse:
      type: object
      properties:
        message:
          type: string
          examples:
            - Transactional email not found.
      required:
        - message
      examples:
        - message: Transactional email not found.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

## Related topics

- [Create a transactional email](https://loops.so/docs/api-reference/create-transactional-email.md)
- [API Introduction](https://loops.so/docs/api-reference/intro.md)
- [Transactional email](https://loops.so/docs/transactional.md)
- [Transactional email API examples](https://loops.so/docs/api-reference/examples/transactional-emails.md)
- [Update a transactional email](https://loops.so/docs/api-reference/update-transactional-email.md)
