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

console.log(baseTemplateTenantAssociation.id);
{
  "id": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "published_at": "<string>",
  "version": "<string>",
  "data": {
    "routing": {
      "method": "all",
      "channels": [
        "<string>"
      ]
    },
    "content": {
      "version": "<string>",
      "elements": [
        {
          "type": "text",
          "content": "<string>",
          "align": "left",
          "channels": [
            "<string>"
          ],
          "ref": "<string>",
          "if": "<string>",
          "loop": "<string>",
          "text_style": "text",
          "color": "<string>",
          "bold": "<string>",
          "italic": "<string>",
          "strikethrough": "<string>",
          "underline": "<string>",
          "locales": {},
          "format": "markdown"
        }
      ],
      "brand": "<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 retrieve the template.

template_id
string
required

Id of the template to be retrieved.

Response

id
string
required

The template's id

created_at
string
required

The timestamp at which the template was created

updated_at
string
required

The timestamp at which the template was last updated

published_at
string
required

The timestamp at which the template was published

version
string
required

The version of the template

data
TenantTemplateData · object
required

The template's data containing it's routing configs and Elemental content