> ## 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 a transactional email's current draft email message, making it the active version sent to contacts via the Loops transactional API.

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](/api-reference/send-transactional-email) to send
the email.

## Request

### Path parameters

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

### Body

No request body.

## Response

### Success

<ResponseField name="id" type="string" required>
  The transactional email ID.
</ResponseField>

<ResponseField name="name" type="string" required>
  The transactional email's name.
</ResponseField>

<ResponseField name="draftEmailMessageId" type="nullable string" required>
  The ID of the draft email message. This is `null` after a successful publish.
</ResponseField>

<ResponseField name="publishedEmailMessageId" type="nullable string" required>
  The ID of the published email message.
</ResponseField>

<ResponseField name="transactionalGroupId" type="nullable string" required>
  The ID of the group this transactional email belongs to.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp for when the transactional email was created.
</ResponseField>

<ResponseField name="updatedAt" type="string" required>
  ISO 8601 timestamp for when the transactional email was last updated.
</ResponseField>

<ResponseField name="dataVariables" type="array" required>
  Data variable names used by the published email. Empty for unpublished
  transactional emails.
</ResponseField>

### Error

If `id` is invalid, a `400 Bad Request` is returned.

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

A `409 Conflict` is returned if there is no draft to publish.

A `422 Unprocessable Entity` is returned if the draft failed validation, the
sending domain is not verified, or content was flagged as unsafe.

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

<ResponseField name="message" type="string" required>
  An error message describing what went wrong.
</ResponseField>

<ResponseExample>
  ```json Response theme={"dark"}
  {
    "id": "cmnx1d95z001llilji4vapgqs",
    "name": "Welcome email",
    "draftEmailMessageId": null,
    "publishedEmailMessageId": "cmn5bia4i0217tzli8ric8giv",
    "transactionalGroupId": "tgrp_01hxyz",
    "createdAt": "2026-03-28T15:00:00.000Z",
    "updatedAt": "2026-03-28T15:30:00.000Z",
    "dataVariables": [
      "firstName",
      "lastName"
    ]
  }
  ```

  ```json Error response theme={"dark"}
  {
    "message": "No draft to publish."
  }
  ```
</ResponseExample>
