Skip to main content
POST
/
tenants
/
{tenant_id}
/
templates
/
{template_id}
/
publish
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 postTenantTemplatePublishResponse = await client.tenants.templates.publish('template_id', {
  tenant_id: 'tenant_id',
});

console.log(postTenantTemplatePublishResponse.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 that owns the template.

template_id
string
required

Id of the template to be published.

Body

application/json

Request body for publishing a tenant template version

version
string
default:latest

The version of the template to publish (e.g., "v1", "v2", "latest"). If not provided, defaults to "latest".

Response

Template published successfully

Response from publishing a tenant template

id
string
required

The template ID

version
string
required

The published version of the template

published_at
string
required

The timestamp when the template was published