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

# Update Transactional Email

> Update transactional email metadata or body content

Update a transactional email by ID or slug. You can update metadata like `name` and `enabled`, or replace the linked email body with `html` or `blocks`.

Code-managed emails (`managedBy: "code"`, created by [sends with
`trackAs`](/api-reference/transactional/send#track-emails-rendered-in-your-code))
accept only `name`, `enabled` and `labels`. Their content comes from each send,
so `subject`, `previewText`, `html` and `blocks` return `400`. Set `enabled` to
`false` to reject further sends with that `trackAs`.

## Path Parameters

<ParamField path="idOrSlug" type="string" required>
  Transactional email ID or slug
</ParamField>

## Request

<ParamField body="labels" type="string[]">
  Company label names, trimmed and deduplicated. Missing names are created in
  your company. Each name must be non-empty and at most 255 characters. Send
  `[]` to clear assignments. Omit to keep existing labels. `null`, blank names,
  and non-string entries are rejected.
</ParamField>

<ParamField body="name" type="string">
  Transactional email name
</ParamField>

<ParamField body="enabled" type="boolean">
  Whether this transactional email can be sent
</ParamField>

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

<ParamField body="previewText" type="string | null">
  Email preview text. Send `null` to clear it; omit the field to keep the
  current value.
</ParamField>

<ParamField body="html" type="string">
  Raw HTML body. Provide either `html` or `blocks`, not both.
</ParamField>

<ParamField body="blocks" type="array">
  Sequenzy email blocks. Provide either `blocks` or `html`, not both. Put block
  styling under `styles`; top-level style keys like `backgroundColor`,
  `backgroundOpacity`, `textColor`, `textAlign`, `borderColor`, `borderWidth`,
  and `borderRadius` are normalized into `styles`.
</ParamField>

```bash theme={null}
curl -X PATCH "https://api.sequenzy.com/api/v1/transactional/welcome" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Welcome, {{NAME}}",
    "html": "<p>Welcome to {{COMPANY_NAME}}</p>"
  }'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "transactional": {
      "id": "txn_abc123",
      "name": "Welcome Email",
      "slug": "welcome",
      "emailId": "email_abc123",
      "labels": ["Billing"],
      "enabled": true,
      "subject": "Welcome, {{NAME}}",
      "previewText": "Your account is ready.",
      "blocks": [
        {
          "id": "block_123",
          "type": "text",
          "content": "<p>Welcome to {{COMPANY_NAME}}</p>",
          "variant": "html"
        }
      ],
      "variables": ["NAME", "COMPANY_NAME"],
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:35:00Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Provide at least one of name, enabled, subject, previewText, html, blocks, or labels."
  }
  ```

  ```json 400 Code-managed content theme={null}
  {
    "success": false,
    "error": "This transactional email is managed in code. Its content comes from each send; update name, enabled or labels instead."
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized"
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "error": "Transactional email \"welcome\" not found"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "error": "Internal server error"
  }
  ```
</ResponseExample>

Label names appear in the response's `transactional.labels` array. Invalid
label names return `400`; invalid label types return `422`. Retrying the same
label replacement does not duplicate company labels or send an email. After
an uncertain update response, read the template before retrying. Label-only
updates preserve email content and translations.

Insufficient API-key permissions return `403`. Label support uses the existing transactional write permission; no additional label scope is required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.