> ## 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.

# Put Notification Locale

> Set locale-specific content overrides for a notification template. Each element override must reference an existing element by ID. Only supported for V2 (elemental) templates.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml put /notifications/{id}/locales/{localeId}
openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API for sending and managing notifications across channels.
  version: 0.0.1
servers:
  - url: https://api.courier.com
    description: Production
security: []
paths:
  /notifications/{id}/locales/{localeId}:
    put:
      tags:
        - Notification Templates
      summary: Put Notification Locale
      description: >-
        Set locale-specific content overrides for a notification template. Each
        element override must reference an existing element by ID. Only
        supported for V2 (elemental) templates.
      operationId: notifications_putLocale
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
        - name: localeId
          in: path
          description: Locale code (e.g., `es`, `fr`, `pt-BR`).
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationLocalePutRequest'
            examples:
              SetSpanishLocale:
                summary: Set Spanish locale overrides
                value:
                  elements:
                    - id: elem_1
                      content: Hola {{data.name}}.
                    - id: elem_2
                      title: Bienvenido!
                  state: DRAFT
      responses:
        '200':
          description: Locale overrides applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationContentMutationResponse'
              examples:
                LocaleUpdated:
                  summary: Locale content set successfully
                  value:
                    id: nt_01abc123
                    version: '2022-01-01'
                    elements:
                      - id: elem_1
                        checksum: abc123
                      - id: elem_2
                        checksum: def456
                    state: DRAFT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'elements: Required'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: >-
            import os

            from courier import Courier


            client = Courier(
                api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
            )

            notification_content_mutation_response =
            client.notifications.put_locale(
                locale_id="localeId",
                id="id",
                elements=[{
                    "id": "elem_1",
                    "content": "Hola {{data.name}}.",
                }, {
                    "id": "elem_2",
                    "title": "Bienvenido!",
                }],
                state="DRAFT",
            )

            print(notification_content_mutation_response.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trycourier/courier-go\"\n\t\"github.com/trycourier/courier-go/option\"\n)\n\nfunc main() {\n\tclient := courier.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tnotificationContentMutationResponse, err := client.Notifications.PutLocale(\n\t\tcontext.TODO(),\n\t\t\"localeId\",\n\t\tcourier.NotificationPutLocaleParams{\n\t\t\tID: \"id\",\n\t\t\tNotificationLocalePutRequest: courier.NotificationLocalePutRequestParam{\n\t\t\t\tElements: []courier.NotificationLocalePutRequestElementParam{{\n\t\t\t\t\tID: \"elem_1\",\n\t\t\t\t}, {\n\t\t\t\t\tID: \"elem_2\",\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", notificationContentMutationResponse.ID)\n}\n"
        - lang: Java
          source: >-
            package com.courier.example;


            import com.courier.client.CourierClient;

            import com.courier.client.okhttp.CourierOkHttpClient;

            import
            com.courier.models.notifications.NotificationContentMutationResponse;

            import
            com.courier.models.notifications.NotificationLocalePutRequest;

            import com.courier.models.notifications.NotificationPutLocaleParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CourierClient client = CourierOkHttpClient.fromEnv();

                    NotificationPutLocaleParams params = NotificationPutLocaleParams.builder()
                        .id("id")
                        .localeId("localeId")
                        .notificationLocalePutRequest(NotificationLocalePutRequest.builder()
                            .addElement(NotificationLocalePutRequest.Element.builder()
                                .id("elem_1")
                                .build())
                            .addElement(NotificationLocalePutRequest.Element.builder()
                                .id("elem_2")
                                .build())
                            .build())
                        .build();
                    NotificationContentMutationResponse notificationContentMutationResponse = client.notifications().putLocale(params);
                }
            }
        - lang: Ruby
          source: >-
            require "courier"


            courier = Courier::Client.new(api_key: "My API Key")


            notification_content_mutation_response =
            courier.notifications.put_locale("localeId", id: "id", elements:
            [{id: "elem_1"}, {id: "elem_2"}])


            puts(notification_content_mutation_response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Courier\Client;

            use Courier\Core\Exceptions\APIException;

            use Courier\Notifications\NotificationTemplateState;


            $client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API
            Key');


            try {
              $notificationContentMutationResponse = $client->notifications->putLocale(
                'localeId',
                id: 'id',
                elements: [['id' => 'elem_1'], ['id' => 'elem_2']],
                state: NotificationTemplateState::DRAFT,
              );

              var_dump($notificationContentMutationResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using TryCourier;

            using TryCourier.Models.Notifications;


            CourierClient client = new();


            NotificationPutLocaleParams parameters = new()

            {
                ID = "id",
                LocaleID = "localeId",
                Elements =
                [
                    new("elem_1"), new("elem_2")
                ],
            };


            var notificationContentMutationResponse = await
            client.Notifications.PutLocale(parameters);


            Console.WriteLine(notificationContentMutationResponse);
        - lang: CLI
          source: |-
            courier notifications put-locale \
              --api-key 'My API Key' \
              --id id \
              --locale-id localeId \
              --element '{id: elem_1}' \
              --element '{id: elem_2}'
components:
  schemas:
    NotificationLocalePutRequest:
      title: NotificationLocalePutRequest
      type: object
      description: >-
        Request body for setting locale-specific content overrides. Each element
        override must include the target element ID.
      properties:
        elements:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Target element ID.
            required:
              - id
            additionalProperties: true
          description: Elements with locale-specific content overrides.
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - elements
    NotificationContentMutationResponse:
      title: NotificationContentMutationResponse
      type: object
      description: >-
        Shared mutation response for `PUT` content, `PUT` element, and `PUT`
        locale operations. Contains the template ID, content version,
        per-element checksums, and resulting state.
      properties:
        id:
          type: string
          description: Template ID.
        version:
          type: string
          description: Content version identifier.
        elements:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              checksum:
                type: string
            required:
              - id
              - checksum
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - id
        - version
        - elements
        - state
    BadRequest:
      title: BadRequest
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    NotFound:
      title: NotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    NotificationTemplateState:
      title: NotificationTemplateState
      type: string
      description: Template state. Defaults to `DRAFT`.
      enum:
        - DRAFT
        - PUBLISHED
      default: DRAFT
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````