Skip to main content
Courier Create reads and writes through these endpoints, so anything the editor does you can script.

Authentication

Two credentials reach these endpoints, and which one you use depends on where the code runs. Your server uses the API key, as above. The browser uses a JWT scoped to one Tenant, which is the same token TemplateProvider takes. Issue it with and scope it as lists. Never send the API key from a browser. It carries the whole workspace, not one Tenant, so a customer holding it can read and write every other customer’s Templates.

Endpoints

A PUT replaces the draft rather than merging into it, so send the whole document. Reading first and writing back a modified copy is the safe order.

Publishing is a separate call

A write leaves a draft. A draft does not send, so a customer who edits and closes the tab has changed nothing a recipient will see. Publishing is what promotes it.
The editor publishes for the customer through its own button, or through useTemplateActions when you hide it. See .

Versions

Publishing keeps the previous published document, and reads one back by version. Use it to show a customer what changed, or to restore a document by writing an older version back with a PUT.

Common responses

401 and 403 separate cleanly, and the difference is worth reading. A 401 means fix the token. A 403 means the token works but was scoped too narrowly, which for a JWT usually means a brand scope is missing or the tenant in the scope is not the one in the path.

Tenant Templates are not workspace Templates

These two live in different places and neither endpoint reaches the other. A Template your customer writes in Courier Create does not appear in the workspace Template list, and a workspace Template is not editable through these endpoints. Sending to a Tenant resolves that Tenant’s own Template.

Verify

List the Tenant’s Templates, write a draft with a PUT, then read it back. Publish it and read it again. The published document is what a send to that Tenant now resolves.

Limits & behavior

  • A PUT replaces, it does not merge. Send the whole document or read first.
  • A write is a draft. Nothing reaches a recipient until a publish call.
  • A JWT is scoped to one Tenant. The tenant in the scope has to match the tenant_id in the path.
  • Content needs a channel wrapper. An Elemental document stored without one fails validation with a 400.

FAQ

A write leaves a draft. Call the publish endpoint, or publish from the editor, before a send resolves the new document.
A 401 means the credential is missing, malformed, or expired. A 403 means the credential is valid but too narrowly scoped, usually a missing brand scope or a tenant scope that does not match the path.
Tenant Templates and workspace Templates are separate. Workspace Templates live under /notifications and are documented in the .
A browser can call them with a Tenant-scoped JWT. The API key stays on your server, because it carries the whole workspace rather than one Tenant.