> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Whatsapp message template



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/whatsapp/management.yml patch /whatsapp/message_templates/{id}
openapi: 3.1.0
info:
  title: Telnyx WhatsApp Management API
  version: 2.0.0
  description: >
    API for managing WhatsApp Business Accounts (WABAs), phone numbers, and
    message templates.


    Use these endpoints to:

    - List and manage WhatsApp Business Accounts

    - Configure phone numbers for WhatsApp

    - Create and manage message templates

    - Set up webhook configurations
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /whatsapp/message_templates/{id}:
    patch:
      tags:
        - Whatsapp Message Templates
      summary: Update a Whatsapp message template
      operationId: PatchWhatsappTemplate
      parameters:
        - $ref: '#/components/parameters/WhatsappTemplateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappUpdateTemplateRequest'
      responses:
        '200':
          $ref: '#/components/responses/WhatsappTemplateSingleResponse'
          description: Updated template
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const whatsappMessageTemplate = await
            client.whatsappMessageTemplates.update('id');


            console.log(whatsappMessageTemplate.data);
        - lang: Python
          source: >-
            import os

            from telnyx import Telnyx


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

            whatsapp_message_template =
            client.whatsapp_message_templates.update(
                id="id",
            )

            print(whatsapp_message_template.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twhatsappMessageTemplate, err := client.WhatsappMessageTemplates.Update(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\ttelnyx.WhatsappMessageTemplateUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", whatsappMessageTemplate.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.whatsappmessagetemplates.WhatsappMessageTemplateUpdateParams;

            import
            com.telnyx.sdk.models.whatsappmessagetemplates.WhatsappMessageTemplateUpdateResponse;


            public final class Main {
                private Main() {}

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

                    WhatsappMessageTemplateUpdateResponse whatsappMessageTemplate = client.whatsappMessageTemplates().update("id");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            whatsapp_message_template =
            telnyx.whatsapp_message_templates.update("id")


            puts(whatsapp_message_template)
        - lang: CLI
          source: |-
            telnyx whatsapp-message-templates update \
              --api-key 'My API Key' \
              --id id
components:
  parameters:
    WhatsappTemplateId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Whatsapp message template ID
  schemas:
    WhatsappUpdateTemplateRequest:
      type: object
      properties:
        category:
          type: string
          enum:
            - MARKETING
            - UTILITY
            - AUTHENTICATION
        components:
          type: array
          description: Updated template components. Same structure as the create request.
          items:
            oneOf:
              - $ref: '#/components/schemas/WhatsappTemplateHeaderComponent'
              - $ref: '#/components/schemas/WhatsappTemplateBodyComponent'
              - $ref: '#/components/schemas/WhatsappTemplateFooterComponent'
              - $ref: '#/components/schemas/WhatsappTemplateButtonsComponent'
              - $ref: '#/components/schemas/WhatsappTemplateCarouselComponent'
            description: >-
              A template component. Additional Meta component types not listed
              here are also accepted.
    WhatsappTemplateHeaderComponent:
      type: object
      description: Optional header displayed at the top of the message.
      required:
        - type
        - format
      properties:
        type:
          type: string
          enum:
            - HEADER
        format:
          type: string
          enum:
            - TEXT
            - IMAGE
            - VIDEO
            - DOCUMENT
            - LOCATION
          description: >-
            Header format type: TEXT (supports one variable), IMAGE, VIDEO,
            DOCUMENT, or LOCATION.
        text:
          type: string
          description: >-
            Header text. Required when format is TEXT. Supports one variable
            ({{1}}). Variables cannot be at the start or end.
        example:
          type: object
          description: Sample values for header variables.
          properties:
            header_text:
              type: array
              items:
                type: string
              description: Sample values for text header variables.
            header_handle:
              type: array
              items:
                type: string
              description: Media handle for IMAGE, VIDEO, or DOCUMENT headers.
    WhatsappTemplateBodyComponent:
      type: object
      description: >-
        The main text content of the message. Supports multiple variable
        parameters ({{1}}, {{2}}, etc.). Variables cannot be at the start or
        end. Maximum 1024 characters.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - BODY
        text:
          type: string
          description: >-
            Body text content. Use {{1}}, {{2}}, etc. for variable placeholders.
            Required for MARKETING and UTILITY templates. Optional for
            AUTHENTICATION templates where Meta provides the built-in OTP body.
          maxLength: 1024
        example:
          type: object
          description: >-
            Sample values for body variables. Required when body text contains
            parameters.
          properties:
            body_text:
              type: array
              description: >-
                Array containing one array of sample values, one per variable in
                order.
              items:
                type: array
                items:
                  type: string
    WhatsappTemplateFooterComponent:
      type: object
      description: >-
        Optional footer displayed at the bottom of the message. Does not support
        variables.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - FOOTER
        text:
          type: string
          description: >-
            Footer text. Maximum 60 characters. For non-authentication
            templates.
          maxLength: 60
        code_expiration_minutes:
          type: integer
          description: >-
            OTP code expiration time in minutes. Used in AUTHENTICATION template
            footers instead of free-form text.
    WhatsappTemplateButtonsComponent:
      type: object
      description: Optional interactive buttons. Maximum 3 buttons per template.
      required:
        - type
        - buttons
      properties:
        type:
          type: string
          enum:
            - BUTTONS
        buttons:
          type: array
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - URL
                  - PHONE_NUMBER
                  - QUICK_REPLY
                  - OTP
                  - COPY_CODE
                  - FLOW
              text:
                type: string
                maxLength: 25
                description: >-
                  Button label text. Maximum 25 characters. Required for URL,
                  PHONE_NUMBER, and QUICK_REPLY buttons. Not required for OTP
                  buttons (Meta supplies the label).
              url:
                type: string
                description: URL for URL-type buttons. Supports one variable ({{1}}).
              phone_number:
                type: string
                description: Phone number in E.164 format.
              otp_type:
                type: string
                enum:
                  - COPY_CODE
                  - ONE_TAP
              example:
                type: array
                items:
                  type: string
                description: Sample values for URL variable.
              package_name:
                type: string
                description: Android package name. Required for ONE_TAP OTP buttons.
              signature_hash:
                type: string
                description: >-
                  Android app signing key hash. Required for ONE_TAP OTP
                  buttons.
              autofill_text:
                type: string
                description: Custom autofill button text for ONE_TAP OTP buttons.
              zero_tap_terms_accepted:
                type: boolean
                description: Whether zero-tap terms have been accepted.
              flow_id:
                type: string
                description: Flow ID for FLOW-type buttons.
              flow_action:
                type: string
                enum:
                  - navigate
                  - data_exchange
                description: Flow action type for FLOW-type buttons.
              navigate_screen:
                type: string
                description: Target screen name for FLOW buttons with navigate action.
          description: >-
            Array of button objects. Meta supports various combinations of
            button types.
    WhatsappTemplateCarouselComponent:
      type: object
      description: >-
        Carousel component for multi-card templates. Each card can contain its
        own header, body, and buttons.
      required:
        - type
        - cards
      properties:
        type:
          type: string
          enum:
            - CAROUSEL
        cards:
          type: array
          description: Array of card objects, each with its own components.
          items:
            type: object
            properties:
              components:
                type: array
                items:
                  type: object
    WhatsappTemplateData:
      type: object
      properties:
        id:
          type: string
        record_type:
          type: string
          example: whatsapp_message_template
        template_id:
          type: string
        name:
          type: string
        category:
          type: string
          enum:
            - MARKETING
            - UTILITY
            - AUTHENTICATION
        language:
          type: string
        status:
          type: string
          description: >-
            Current template status from Meta (e.g. PENDING, APPROVED, REJECTED,
            PAUSED, DISABLED). Additional statuses may be returned as Meta
            evolves the template lifecycle.
        rejection_reason:
          type: string
        components:
          type: array
          items:
            type: object
          description: >-
            Template components (header, body, footer, buttons) as submitted,
            including example values.
        whatsapp_business_account:
          type: object
          properties:
            id:
              type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    messaging_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/messaging_Error'
    messaging_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
  responses:
    WhatsappTemplateSingleResponse:
      description: Successful response with Whatsapp template
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/WhatsappTemplateData'
    messaging_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````