v93

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01218121759.7 KB
Transactional

Create transactional email

Creates a saved transactional email template from exactly one of prompt, HTML, or Sequenzy blocks. Prompt-created templates default to disabled.

post/transactional

Request body

htmlstring

Raw HTML body. Provide either html or blocks, not both.

namestring required
slugstring

Optional API slug used when sending by slug. If omitted, one is generated from the name.

subjectstring

Required with HTML or blocks; optional with prompt, where it overrides the generated subject.

previewTextstring nullable
promptstring

Natural-language request for branded transactional blocks.

stylestring

Generation style; valid only with prompt.

tonestring

Generation tone; valid only with prompt.

enabledboolean

Defaults to false with prompt and true with explicit HTML or blocks.

Example request

{
  "html": "<h1>Hello</h1>",
  "blocks": [
    {
      "id": "block_123",
      "type": "html",
      "content": "<h1>Hello</h1>",
      "styles": {
        "backgroundColor": "#f8fafc",
        "backgroundOpacity": 80,
        "textColor": "#111827",
        "borderRadius": 12,
        "borderColor": "#cbd5e1",
        "borderWidth": 1
      },
      "conditions": [
        {
          "id": "c1",
          "value": "plan:pro"
        }
      ]
    }
  ],
  "name": "Password Reset",
  "slug": "password-reset",
  "subject": "Reset your password, {{NAME}}",
  "previewText": "Use this link to reset your password.",
  "enabled": true
}

Response

Transactional email created

successboolean
warningsstring[]

Non-blocking advisories about the blocks that were written. The write succeeded. Present when a field was not part of the block schema and was discarded, or when a supported field does not control what its name suggests for that block type - for example styles.backgroundColor on a button colors the band behind the button while the fill comes from buttonColor. Each message names the offending path and the fields that block does accept. A sequence email step update also reports the blocks the step's existing Style > Format added back on top of the submitted blocks, because the response echoes node config rather than the stored blocks. Absent when there is nothing to report.

Example response

{
  "success": true,
  "transactional": {
    "id": "tx_abc123",
    "name": "Welcome Email",
    "slug": "welcome-email",
    "emailId": "email_123",
    "enabled": true,
    "variables": [
      "NAME",
      "COMPANY",
      "PRODUCT"
    ],
    "subject": "Welcome, {{NAME}}",
    "previewText": "Your account is ready.",
    "blocks": [
      {
        "id": "block_123",
        "type": "html",
        "content": "<h1>Hello</h1>",
        "styles": {
          "backgroundColor": "#f8fafc",
          "backgroundOpacity": 80,
          "textColor": "#111827",
          "borderRadius": 12,
          "borderColor": "#cbd5e1",
          "borderWidth": 1
        },
        "conditions": [
          {
            "id": "c1",
            "value": "plan:pro"
          }
        ]
      }
    ],
    "email": {
      "id": "email_123",
      "companyId": "company_123",
      "name": "Welcome email",
      "subject": "Welcome",
      "previewText": "Here's what to do next",
      "blocks": [
        {
          "id": "block_123",
          "type": "html",
          "content": "<h1>Hello</h1>",
          "styles": {
            "backgroundColor": "#f8fafc",
            "backgroundOpacity": 80,
            "textColor": "#111827",
            "borderRadius": 12,
            "borderColor": "#cbd5e1",
            "borderWidth": 1
          },
          "conditions": [
            {
              "id": "c1",
              "value": "plan:pro"
            }
          ]
        }
      ]
    }
  },
  "warnings": [
    "blocks[0].styles.color is not a supported field and was ignored. Button label color comes from the block-level `buttonTextColor` field. Supported styles fields: backgroundColor, backgroundOpacity, bleed, borderColor, borderRadius, borderWidth, paddingBottom, paddingLeft, paddingRight, paddingTop, textAlign, textColor."
  ]
}