These endpoints manage templates scoped to a specific tenant (
/tenants/{tenant_id}/templates/...). They are part of the Courier Create feature set and are separate from workspace-level notification templates you configure in the Courier dashboard.Prerequisites
- Courier API key with permission to manage tenant notification templates (or a JWT with the right scopes if you mirror Courier Create authentication)
- A tenant ID (replace placeholders below)
- Node.js (
npm install @trycourier/courier) or Python (pip install trycourier)
TEMPLATE_ID per tenant; reusing the same ID updates the template in place. Export:
Step 1: Create a draft template
Save an initial draft withpublished: false. The body uses TenantTemplateInput with required content (Elemental). This example uses email-oriented elements at the root: meta (subject), text, and an action link.
Step 2: Update the draft
Refine copy without publishing yet: send anotherPUT with the same template_id, still published: false. Add a divider and a support line so the email matches what you might ship after review.
Step 3: Publish
CallPOST /tenants/{tenant_id}/templates/{template_id}/publish with an empty body (or {"version": "latest"}) to publish the latest draft.
Step 4: Read the published version
Confirm what recipients will see by fetching the published snapshot:latest for the newest saved draft (published or not, depending on your workflow) and published for what is live.
Step 5: Send a message using the template
Reference a tenant template in the Send API by prefixing the template ID withtenant/ and setting context.tenant_id:
tenant/ prefix tells the Send API to resolve the template from the tenant’s notification map rather than from workspace-level notifications.
What you built
You now have a published template with version history: drafts fromPUT with published: false, a live version from POST .../publish, a way to audit what is live via GET .../versions/published, and a send call that delivers messages using the template.