Skip to main content
Create, update, publish, and manage notification templates over Courier’s Templates API. Each template stores Elemental content and reusable routing, the same assets you edit in Design Studio.
The Templates API tutorial walks through create, publish, and send end-to-end with working code.

Endpoints

Authenticate every request with your workspace API key as a Bearer token: Authorization: Bearer <token>.

Create a template

Send POST /notifications with a notification object and an optional state flag (defaults to DRAFT). Set COURIER_API_KEY in your environment first.
The notification object has two parts you’ll set most often:
  • routing: which channels and providers to use. Pass null to skip it for now, or { "strategy_id": "rs_..." } to attach an existing strategy.
  • content: the notification body, written in Elemental, Courier’s JSON templating format. A version plus an elements array of blocks like meta, text, action, and channel.

Update, publish, and read

  • Update: PUT /notifications/{id}/content updates the draft body. PUT /notifications/{id} replaces the whole template.
  • Publish: POST /notifications/{id}/publish promotes the current draft (or a specific version) to live.
  • Read: GET /notifications/{id}/draft/content returns the draft body, and GET /notifications/{id}/content returns the published body.

Add HTML to a template

To author HTML through the API, for example when porting a legacy email, put a complete HTML document on the email channel node’s raw.html with the handlebars transformer. The meta title sets the subject.

Next steps

Templates API tutorial

Create, publish, and send end-to-end.

Elemental overview

How Elemental documents are structured.

HTML blocks

Inline and whole-email HTML in email.

Routing configuration

Attach channels and providers to a template.