Skip to main content
PUT
/
notifications
/
{id}
/
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.notifications.putLocale('localeId', {
  id: 'id',
  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

id
string
required

Notification template ID (nt_ prefix).

localeId
string
required

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

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

Locale overrides applied.

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