---
openapi: 3.0.3
info:
  title: Braze REST API – Update translations for an email template
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `templates.translations.update` permission.

    ## Rate limit

    This endpoint has a rate limit of 250,000 requests per hour.
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
# cspell:ignore llamo Dónde está biblioteca
paths:
  "/templates/email/translations/":
    put:
      summary: Update translations for an email template
      operationId: put_templates_email_translations_put_update_template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplateRequest'
            examples:
              update_translations:
                summary: Update translations for a locale
                value:
                  template_id: e24404b3-3626-4de0-bdec-06935f3aa0ab
                  locale_id: h94404b3-3626-4de0-bdec-06935f3aa0ad
                  translation_map:
                    id_0: ¡Hola!
                    id_1: Me llamo Jacky
                    id_2: ¿Dónde está la biblioteca?
      responses:
        "200":
          description: |
            The request succeeded and the response body includes the updated template translations. No action needed.

            The following sample response shows an example of the response returned when you update translations for an email template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateTemplateResponse'
              examples:
                success:
                  summary: Translations updated
                  value:
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `template_id` isn't a valid UUID:** Pass a valid `template_id`. Find it with the [List email templates endpoint]({{site.baseurl}}/api/endpoints/templates/email_templates/get_list_email_templates/).
            - **No template matches the `template_id`:** Pass a `template_id` for an existing email template.
            - **The `locale_id` isn't a valid UUID:** Pass a valid `locale_id` UUID.
            - **No locale matches the `locale_id`:** Pass a `locale_id` that exists on the object.
            - **The template doesn't have multi-language set up:** Enable multi-language on the template first.
            - **The template type doesn't support multi-language:** Use a template that supports multi-language translations.
            - **The request body doesn't include `translation_map`:** Include a `translation_map` object in the request body.
            - **The `translation_map` object is malformed:** Send a valid `translation_map` object.
            - **Another request modified the template at the same time:** Retry the request.

            The status code `400` could return the following response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                concurrent_modification:
                  summary: Template modified by another request
                  value:
                    errors:
                      - message: Template was modified by another request. Please retry.
                invalid_template_id:
                  summary: Invalid template ID
                  value:
                    message: Invalid template ID
                template_not_found:
                  summary: Template not found
                  value:
                    message: Template not found
                invalid_locale_id:
                  summary: Invalid locale ID
                  value:
                    message: Invalid locale ID
                locale_not_found:
                  summary: Locale not found
                  value:
                    message: Locale not found
                template_not_set_up:
                  summary: Template doesn't have multi-language set up
                  value:
                    message: This template does not have multi-language setup
                template_type_not_supported:
                  summary: Template type doesn't support multi-language
                  value:
                    message: This template type does not support multi-language
                missing_translations:
                  summary: Missing translation_map
                  value:
                    message: Missing translations from the request body
                invalid_translation_object:
                  summary: Malformed translation_map
                  value:
                    message: Invalid translation object
        "401":
          description: |
            Unauthorized. The REST API key is missing, malformed, or sent to the wrong REST endpoint. Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    message: 'Invalid API key: YOUR_REST_API_KEY'
        "403":
          description: Access denied. The REST API key doesn't have the required permission. Use a REST API key that has the `templates.translations.update` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Missing permission
                  value:
                    message: Access Denied
        "429":
          description: |
            Rate limited. You exceeded the rate limit for this endpoint. Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    message: You have exceeded your limit of 250000 requests per hour. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
      description: |
        REST API keys are created in the Braze dashboard at **Settings → APIs and
        Identifiers → API Keys**. The key must include the `templates.translations.update` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    UpdateTemplateRequest:
      title: Update email template translations request
      type: object
      required: [template_id, locale_id, translation_map]
      properties:
        template_id:
          type: string
          description: The ID of your email template.
          example: e24404b3-3626-4de0-bdec-06935f3aa0ab
        locale_id:
          type: string
          description: The ID of the locale.
          example: h94404b3-3626-4de0-bdec-06935f3aa0ad
        translation_map:
          title: Translation map
          type: object
          description: The map of the translations for your email template.
          additionalProperties:
            type: string
          example:
            id_0: ¡Hola!
            id_1: Me llamo Jacky
            id_2: ¿Dónde está la biblioteca?
    UpdateTemplateResponse:
      title: Update email template translations response
      type: object
      properties:
        message:
          type: string
          example: success
    ErrorResponse:
      title: Error
      type: object
      properties:
        message:
          type: string
          description: The error message describing why the request failed.
        errors:
          type: array
          description: Non-fatal errors encountered while processing the request. Data unaffected by these errors is still processed.
          items:
            title: Error detail
            type: object
            properties:
              message:
                type: string
              type:
                type: string
                description: The error type.
