Skip to main content
PUT
/
journeys
/
{templateId}
/
templates
/
{notificationId}
/
locales
/
{localeId}
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 notificationContentMutationResponse = await client.journeys.templates.putLocale('x', {
  templateId: 'x',
  notificationId: 'x',
  elements: [
    { id: 'elem_1', content: 'Hola {{data.name}}.' },
    { id: 'elem_2', title: 'Bienvenido!' },
  ],
  state: 'DRAFT',
});

console.log(notificationContentMutationResponse.id);
{
  "id": "nt_01abc123",
  "version": "2022-01-01",
  "elements": [
    {
      "id": "elem_1",
      "checksum": "abc123"
    },
    {
      "id": "elem_2",
      "checksum": "def456"
    }
  ],
  "state": "DRAFT"
}

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
localeId
string
required

Locale code (e.g., es, fr, pt-BR).

Minimum string length: 1

Body

application/json

Request body for setting locale-specific content overrides. Each element override must include the target element ID.

elements
object[]
required

Elements with locale-specific content overrides.

state
enum<string>
default:DRAFT

Template state. Defaults to DRAFT.

Available options:
DRAFT,
PUBLISHED

Response

Updated scoped notification locale

Shared mutation response for PUT content, PUT element, and PUT locale operations. Contains the template ID, content version, per-element checksums, and resulting state.

id
string
required

Template ID.

version
string
required

Content version identifier.

elements
object[]
required
state
enum<string>
default:DRAFT
required

Template state. Defaults to DRAFT.

Available options:
DRAFT,
PUBLISHED