Update a template

Change a template.

On this page
PATCHhttps://app.usenotix.dev/api/v1/templates/{templateId}

Needs a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.

Change a template. Fields left out are unchanged, and the stored body is rewritten only when content or html is sent - a rename on its own leaves the body alone.

Path parameters

templateIdstringrequired

Body parameters

namestring

At most 200 characters.

subjectstring
typestring

One of TRANSACTIONAL, MARKETING.

previewTextstring

At most 255 characters.

contentstring
htmlstring
aliasstring

Lower-case letters, numbers and -, unique in the team. null clears it.

Can be null.

fromAddressstring

An address on a verified domain of the team. null clears it.

At most 320 characters. Can be null.

replyTostring

One email address. null clears it.

At most 320 characters. Can be null.

variablesobject[]

Declared variables: key, type TEXT or NUMBER, and an optional fallback.

variables[].keystringrequired
variables[].typestringrequired

One of TEXT, NUMBER.

variables[].fallbackstring

At most 500 characters. Can be null.

publishboolean

Default true: the change goes live at once, as before, when it passes Publish's checks (a subject; and, once the template declares variables, every {{variable}} declared). When it does not, it is saved as a draft, the published version is left as it was, and the call answers 400 with savedAsDraft, templateId and problems. false saves a draft; publish it later with POST /v1/templates/{templateId}/publish.

Headers

Authorizationstringrequired

Bearer followed by your API key.

curl -X PATCH "https://app.usenotix.dev/api/v1/templates/<templateId>" \
  -H "Authorization: Bearer $NOTIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme",
  "subject": "Your receipt for order 4471",
  "type": "TRANSACTIONAL",
  "previewText": "Thanks for your order.",
  "content": "string",
  "html": "<p>Thanks for your order.</p>",
  "alias": "string",
  "fromAddress": "string",
  "replyTo": "string",
  "variables": [
    {
      "key": "string",
      "type": "TEXT"
    }
  ],
  "publish": true
}'
Response200
{
  "id": "cm5t3mplat3id0000",
  "name": "Order receipt",
  "subject": "Your order {{orderId}}",
  "type": "TRANSACTIONAL",
  "html": "<p>Thanks for your order.</p>",
  "status": "DRAFT",
  "unpublishedChanges": true,
  "variables": [
    {
      "key": "string",
      "type": "TEXT"
    }
  ]
}
Open in ClaudeOpen in ChatGPT