Publish a template

Make the working copy the version every send uses, as the editor's Publish does.

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

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

Make the working copy the version every send uses, as the editor's Publish does. Sends by templateId (its ID or its alias) always use the published version; a template that was never published answers 400 when sent. Publishing is refused with 400 when the subject is empty, when the HTML or subject uses a variable that is neither declared in variables nor a contact property, or when the template's From is not on a verified domain of the team; problems lists each one. The subject, body, preview text, From, Reply-to and declared variables are published together, so a draft change to any of them reaches no send until it is published. POST and PATCH /v1/templates publish at once, as they always have, when these checks pass (a template that declares no variables keeps its free-form ones); otherwise they save the change as a draft, leave the published version as it was and answer 400 with savedAsDraft: true, templateId and problems. Pass publish: false to save a draft on purpose.

Who can call it

Full access keys. Read only, send-only and live AI keys answer 403 SCOPE_DENIED.

Path parameters

templateIdstringrequired

Headers

Authorizationstringrequired

Bearer followed by your API key.

Errors

400

Not published: `details.problems` lists each thing to fix, such as an empty subject or a variable in the HTML that is not declared, or a From off the team's verified domains.

404

No template with this ID in the calling team.

Every error has the same shape. See all error codes.

curl -X POST "https://app.usenotix.dev/api/v1/templates/<templateId>/publish" \
  -H "Authorization: Bearer $NOTIX_API_KEY"
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