Notification template endpoints
Templates API requests are authenticated by passing your workspace API key as a Bearer token in theAuthorization header: Authorization: Bearer <token>. Requests without this header are rejected.
| Endpoint | Purpose |
|---|---|
GET /notifications | List templates (paginated). |
POST /notifications | Create a template. |
GET /notifications/{id} | Get one template (metadata and settings). |
PUT /notifications/{id} | Replace a template in full. |
GET /notifications/{id}/draft/content | Read draft Elemental content. |
GET /notifications/{id}/content | Read published Elemental content. |
POST /notifications/{id}/publish | Publish a draft (or a specific version). |
GET /notifications/{id}/versions | List template versions. |
DELETE /notifications/{id} | Archive a template. |
Design Studio alignment: routing and Elemental
Design Studio stores Elemental notification content and attaches reusable routing (which channels/providers to use). When you create or replace a template over the wire, thenotification object must include routing: use null if you are not attaching a strategy yet, or { "strategy_id": "rs_..." } with a strategy that already exists in your workspace (for example from GET /notifications/{id} or Studio). notification.content follows Elemental: a version (for example 2022-01-01) and an elements array using element types such as meta, text, action, channel, etc. See Elemental overview and routing configuration.
Example: create a template (POST /notifications)
POST /notifications takes published and notification. Set COURIER_API_KEY in your environment. The Templates API tutorial walks through create, publish, and send end-to-end with the same REST API.
cURL
HTML elements in Elemental content
In addition to Courier’s predefined Elemental blocks (meta, text, action, and the rest), you can supply your own HTML in Elemental: use "type": "html" and put the markup in content. That HTML path is email-only; other message formats (for example push or SMS) don’t render HTML, so this block isn’t available there. See the HTML element reference for structure and options like locales.
Publish and read content
- Publish:
POST /notifications/{id}/publish— body can target the latest draft or a specific version, depending on your workflow. - Draft body:
GET /notifications/{id}/draft/content— current draft Elemental document. - Published body:
GET /notifications/{id}/content— published Elemental document.
What’s Next
Templates API
Full
/notifications endpoint guide and API Reference linksTemplates API tutorial
End-to-end curl and send example
Elemental overview
Structure of Elemental documents
Design Studio overview
Editing templates in the UI