Skip to main content
PUT
/
tenants
/
{tenant_id}
/
templates
/
{template_id}
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const putTenantTemplateResponse = await client.tenants.templates.replace('template_id', {
  tenant_id: 'tenant_id',
  template: { content: { elements: [{}], version: 'version' } },
});

console.log(putTenantTemplateResponse.id);
{
  "id": "<string>",
  "version": "<string>",
  "published_at": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

tenant_id
string
required

Id of the tenant for which to create or update the template.

template_id
string
required

Id of the template to be created or updated.

Body

application/json

Request body for creating or updating a tenant notification template

template
TenantTemplateInput · object
required

Template configuration for creating or updating a tenant notification template

published
boolean
default:false

Whether to publish the template immediately after saving. When true, the template becomes the active/published version. When false (default), the template is saved as a draft.

Response

Template updated successfully

Response from creating or updating a tenant notification template

id
string
required

The template ID

version
string
required

The version of the saved template

published_at
string | null

The timestamp when the template was published. Only present if the template was published as part of this request.