Create Notification Template
Create a notification template. Requires all fields in the notification object. Templates are created in draft state by default.
Content must place its elements inside a channel block — { "type": "channel", "channel": "email", "elements": [...] } — or the request returns 400. The template designer renders only the channel block matching the tab it draws, so content stored without one cannot be opened. An empty elements array is accepted, and the requirement applies to creation only: PUT /notifications/{id} still accepts unwrapped content. Note this endpoint takes versioned content only — the { title, body } shorthand accepted by /send is rejected here with an invalid_request_error on notification.content.version.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
A unique key that makes this request idempotent. If Courier receives another request with the same Idempotency-Key, it returns the stored response from the first request without performing the operation again (including the original status code and any error). Use it to safely retry POST requests after network failures without risking duplicate sends. The key is scoped to this endpoint.
How long the idempotency key remains valid, as a Unix epoch timestamp in seconds or an ISO 8601 date string. Only applies when Idempotency-Key is provided. If omitted, the key is retained for 25 hours; the maximum is 1 year.
Body
Request body for creating a notification template.
Template fields accepted in POST and PUT request bodies, nested under a notification key.
Template state after creation. Case-insensitive input, normalized to uppercase in the response. Defaults to "DRAFT".
DRAFT, PUBLISHED Response
Created
Response for GET /notifications/{id}, POST /notifications, and PUT /notifications/{id}. Returns all template fields at the top level.
Display name for the template.
Tags for categorization. Send empty array for none.
Brand reference, or null for no brand.
Subscription topic reference, or null for none.
Routing strategy reference, or null for none.
Elemental content definition.
The template ID.
The template state. Always uppercase.
DRAFT, PUBLISHED Epoch milliseconds when the template was created.
User ID of the creator.
A template's send-time alias as returned by a read, omitted entirely when it has none. Usually a single string; an array for a template that resolves from several aliases, which writes through this API can no longer produce — only templates predating that restriction, or aliases attached outside this API, hold more than one.
Epoch milliseconds of last update.
User ID of the last updater.