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

## Path Parameters

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

## Request

<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">
  Email preview text
</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`, `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",
      "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, or blocks."
  }
  ```

  ```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>
