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 notificationTemplateGetResponse = await client.notifications.retrieve('id');

console.log(notificationTemplateGetResponse.created);
{
  "notification": {
    "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"
}

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

Envelope response for GET /notifications/{id}. The notification object mirrors the POST/PUT input shape. Nullable fields return null when unset.

notification
NotificationTemplatePayload · object
required

Full document shape used in POST and PUT request bodies, and returned inside the GET response envelope.

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.