Emails

Update email

Updates email metadata or replaces the email body.

patch/emails/{emailId}

Path parameters

emailIdstring required

Email ID

Request body

htmlstring

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

namestring
subjectstring
previewTextstring nullable

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"
        }
      ]
    }
  ]
}

Response

Email updated

successboolean

Example response

{
  "success": true,
  "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"
          }
        ]
      }
    ]
  }
}

Changes