Skip to main content
PUT
/
journeys
/
{templateId}
/
templates
/
{notificationId}
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 journeyTemplateGetResponse = await client.journeys.templates.replace('x', {
  templateId: 'x',
  notification: {
    brand: { id: 'id' },
    content: { elements: [{}], version: '2022-01-01' },
    name: 'name',
    subscription: { topic_id: 'topic_id' },
    tags: ['string'],
  },
});

console.log(journeyTemplateGetResponse.id);
{
  "name": "Welcome email v2",
  "tags": [],
  "brand": null,
  "subscription": null,
  "content": {
    "scope": "default",
    "version": "2022-01-01",
    "elements": []
  }
}

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

templateId
string
required

Journey id

Minimum string length: 1
notificationId
string
required

Notification template id

Minimum string length: 1

Body

application/json

Request body for replacing a journey-scoped notification template draft.

notification
object
required
state
string

Response

Updated notification template

A journey-scoped notification template.

name
string
required
tags
string[]
required
brand
object
required
subscription
object
required
content
object
required
id
string
required
state
enum<string>
default:DRAFT
required
Available options:
DRAFT,
PUBLISHED
created
integer<int64>
required
creator
string
required
updated
integer<int64>
updater
string