Skip to main content
GET
/
notifications
/
{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 notificationTemplateResponse = await client.notifications.retrieve('id');

console.log(notificationTemplateResponse);
{
  "id": "nt_01abc123",
  "name": "Welcome Email",
  "tags": [
    "onboarding"
  ],
  "brand": {
    "id": "brand_abc"
  },
  "subscription": {
    "topic_id": "marketing"
  },
  "routing": null,
  "content": {
    "version": "2022-01-01",
    "elements": [
      {
        "type": "channel",
        "channel": "email",
        "elements": [
          {
            "type": "meta",
            "title": "Welcome!"
          },
          {
            "type": "text",
            "content": "Hello {{data.name}}."
          }
        ]
      }
    ]
  },
  "state": "PUBLISHED",
  "created": 1710000000000,
  "creator": "user_abc",
  "updated": 1710000001000,
  "updater": "user_def"
}

Documentation Index

Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Template ID (nt_ prefix).

Query Parameters

version
string

Version to retrieve. One of "draft", "published", or a version string like "v001". Defaults to "published".

Response

Response for GET /notifications/{id}, POST /notifications, and PUT /notifications/{id}. Returns all template fields at the top level.

name
string
required

Display name for the template.

tags
string[]
required

Tags for categorization. Send empty array for none.

brand
object
required

Brand reference, or null for no brand.

subscription
object
required

Subscription topic reference, or null for none.

routing
object
required

Routing strategy reference, or null for none.

content
ElementalContent · object
required

Elemental content definition.

id
string
required

The template ID.

state
enum<string>
required

The template state. Always uppercase.

Available options:
DRAFT,
PUBLISHED
created
integer<int64>
required

Epoch milliseconds when the template was created.

creator
string
required

User ID of the creator.

updated
integer<int64>

Epoch milliseconds of last update.

updater
string

User ID of the last updater.