---
openapi: 3.0.3
info:
  title: Braze REST API – Update existing email templates
  description: |
    ## Prerequisites

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

    ## Rate limit

    We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in [API rate limits]({{site.baseurl}}/api/api_limits/).
  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: []
paths:
  "/templates/email/update":
    post:
      summary: Update existing email templates
      operationId: post_templates_email_update_post_update_email_template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmailTemplateRequest'
            examples:
              example_request:
                summary: Update an email template
                value:
                  email_template_id: email_template_id
                  template_name: Weekly Newsletter
                  subject: This Week's Styles
                  body: Check out this week's digital lookbook to inspire your outfits. Take a look at https://www.braze.com/
                  plaintext_body: This is the updated text within my email body and here is a link to https://www.braze.com/.
                  preheader: We want you to have the best looks this summer
                  tags:
                    - Tag1
                    - Tag2
      responses:
        "201":
          description: The request succeeded and the email template was updated. No action needed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateEmailTemplateResponse'
              examples:
                success:
                  summary: Email template updated
                  value:
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `email_template_id` is blank:** Include a valid `email_template_id`.
            - **The `email_template_id` doesn't match a template in this workspace:** Pass a valid `email_template_id`.
            - **The template was deleted:** Use a template that hasn't been deleted.
            - **The template is a drag-and-drop template, which can't be updated by API:** Edit drag-and-drop templates in the dashboard.
            - **No updatable field was provided:** Include at least one field to update.
            - **The `template_name` isn't a string:** Pass `template_name` as a string.
            - **The `subject` is blank:** Include a non-empty `subject`.
            - **The `body` is blank:** Include a non-empty `body`.
            - **The `should_inline_css` value isn't a boolean:** Pass `should_inline_css` as `true` or `false`.
            - **The template references a Content Block that doesn't exist:** Reference only existing Content Blocks.
            - **The `tags` value isn't an array:** Pass `tags` as an array of strings.
            - **A value in `tags` isn't a string:** Make every entry in `tags` a string.
            - **One or more tags don't exist:** Create the tags first, or remove them from `tags`.
            - **The total template size is larger than 8 MB:** Reduce the total size of the template below 8 MB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                template_id_blank:
                  summary: The email_template_id is blank
                  value:
                    message: Email template ID cannot be blank.
                template_id_invalid:
                  summary: The email_template_id doesn't match a template
                  value:
                    message: Email template ID is invalid for this App Group.
                template_deleted:
                  summary: The template was deleted
                  value:
                    message: Email template has been deleted - content not available.
                dnd_not_supported:
                  summary: Drag-and-drop template
                  value:
                    message: Drag-and-drop email templates cannot be updated from the API.
                no_field_specified:
                  summary: No updatable field
                  value:
                    message: You must specify a field to update.
                template_name_not_string:
                  summary: The template_name isn't a string
                  value:
                    message: Template name must be a String.
                subject_blank:
                  summary: The subject is blank
                  value:
                    message: Subject cannot be blank.
                body_blank:
                  summary: The body is blank
                  value:
                    message: Body cannot be blank.
                should_inline_css_invalid:
                  summary: The should_inline_css value isn't a boolean
                  value:
                    message: "Invalid value for 'should_inline_css'.  One of 'true' or 'false' was expected"
                invalid_content_blocks:
                  summary: Content Block doesn't exist
                  value:
                    message: Email must have valid content block names.
                tags_not_array:
                  summary: The tags value isn't an array
                  value:
                    message: Tags must be an array.
                tag_not_string:
                  summary: A value in tags isn't a string
                  value:
                    message: All Tags must be Strings.
                tags_not_found:
                  summary: One or more tags don't exist
                  value:
                    message: "The following Tags could not be found: ['Tag1', 'Tag2']."
                template_too_large:
                  summary: Template larger than 8 MB
                  value:
                    message: The total size of the template must be smaller than 8388608
        "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.email.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.email.update` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    UpdateEmailTemplateRequest:
      title: Update email template request
      type: object
      required: [email_template_id]
      properties:
        email_template_id:
          type: string
          description: Your [email template's API identifier]({{site.baseurl}}/api/identifier_types/).
          example: email_template_id
        template_name:
          type: string
          description: The name of your email template.
          example: Weekly Newsletter
        subject:
          type: string
          description: The email template subject line.
          example: This Week's Styles
        body:
          type: string
          description: The email template body that may include HTML.
          example: Check out this week's digital lookbook to inspire your outfits. Take a look at https://www.braze.com/
        plaintext_body:
          type: string
          description: A plaintext version of the email template body.
          example: This is the updated text within my email body and here is a link to https://www.braze.com/.
        preheader:
          type: string
          description: The email preheader used to generate previews in some clients.
          example: We want you to have the best looks this summer
        tags:
          type: array
          items:
            type: string
          description: '[Tags]({{site.baseurl}}/user_guide/messaging/governance/tags/) must already exist.'
          example:
            - Tag1
            - Tag2
        should_inline_css:
          type: boolean
          description: Enables or disables the `inline_css` feature per template. If not provided, the template keeps its current setting. One of `true` or `false` is expected. If `true`, the `inline_css` feature will be applied to the template.
          example: true
    UpdateEmailTemplateResponse:
      title: Update email template response
      type: object
      properties:
        message:
          type: string
          description: Returns `success` when the request completes without errors.
          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:
            type: object
            properties:
              type:
                type: string
                description: The error type.
