---
title: "Create a transactional email"
method: POST
path: "/v1/transactional-emails"
tags: ["Transactional emails"]
---

# Create a transactional email

`POST /v1/transactional-emails`

Create a new transactional email. An empty draft email message is created automatically and its `draftEmailMessageId` is returned. Use the `POST /v1/email-messages/{emailMessageId}` endpoint along with the returned `draftEmailMessageContentRevisionId` to set subject, sender, preview text, and LMX content, then call `POST /v1/transactional-emails/{transactionalId}/publish` to publish the draft.

## Request body

- CreateTransactionalRequest
  - `name` string, required — The name of the transactional email.
  - `transactionalGroupId` string — The ID of the group to add this transactional email to. Defaults to the team's default group when omitted.

## Response `201`

Transactional email created.

- TransactionalDraftResponse
  - `id` string, required — The ID of the transactional email.
  - `name` string, required — The name of the transactional email.
  - `draftEmailMessageId` string, nullable, required — The ID of the draft email message.
  - `draftEmailMessageContentRevisionId` string, nullable, required — The `contentRevisionId` of the draft email message. Pass this as `expectedRevisionId` on your first update via `POST /v1/email-messages/{emailMessageId}`.
  - `publishedEmailMessageId` string, nullable, required — The ID of the published email message. `null` if there is no published version.
  - `transactionalGroupId` string, nullable — The ID of the group this transactional email belongs to. Returned when creating a transactional email.
  - `createdAt` string, date-time, required — ISO 8601 timestamp for when the transactional email was created.
  - `updatedAt` string, date-time, required — ISO 8601 timestamp for when the transactional email was last updated.
  - `dataVariables` string[], required — Data variable names used by the published email. Empty for unpublished transactional emails.

## Other responses

- `400` — Invalid request body or no sending domain configured.
- `401` — Invalid API key or content API not enabled for this team.
- `405` — Wrong HTTP request method.

---

[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)
