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

# Atualizar template de WhatsApp

> Altera os componentes de um template existente. Nome, categoria e idioma não podem ser alterados — para mudá-los, crie um novo template. Toda edição envia o template para nova análise da Meta.



## OpenAPI

````yaml https://api.jurichat.com/docs/client/openapi.json patch /integration/templates/{integrationId}/{templateId}
openapi: 3.1.0
info:
  title: JuriChat API — Documentação para Integradores
  description: ''
  version: 1.0.0
servers:
  - url: https://api.jurichat.com
    description: Production server
security:
  - apiKeyAuth: []
tags: []
paths:
  /integration/templates/{integrationId}/{templateId}:
    patch:
      tags:
        - Templates
      summary: Atualizar template de WhatsApp
      description: >-
        Altera os componentes de um template existente. Nome, categoria e idioma
        não podem ser alterados — para mudá-los, crie um novo template. Toda
        edição envia o template para nova análise da Meta.
      parameters:
        - schema:
            type: string
            pattern: ^[cC][^\s-]{8,}$
          in: path
          name: integrationId
          required: true
          description: ID da integração de WhatsApp API Oficial do escritório.
        - schema:
            type: string
            minLength: 1
          in: path
          name: templateId
          required: true
          description: ID do template na Meta, devolvido na listagem ou na criação.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                components:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - HEADER
                          - BODY
                          - FOOTER
                          - BUTTONS
                        description: >-
                          Tipo do componente. BODY é obrigatório em todo
                          template.
                      format:
                        type: string
                        enum:
                          - TEXT
                          - IMAGE
                          - VIDEO
                          - DOCUMENT
                          - LOCATION
                        description: >-
                          Formato do cabeçalho. Aplicável somente a componentes
                          HEADER.
                      text:
                        type: string
                        description: >-
                          Conteúdo textual do componente. Use {{1}}, {{2}} para
                          variáveis posicionais.
                      example:
                        type: object
                        properties:
                          header_text:
                            type: array
                            items:
                              type: array
                              items:
                                type: string
                            description: Exemplos das variáveis do cabeçalho de texto.
                          header_handle:
                            type: array
                            items:
                              type: string
                            description: >-
                              Handle da mídia devolvido por POST
                              /integration/templates/{integrationId}/media.
                              Obrigatório em cabeçalhos IMAGE, VIDEO ou
                              DOCUMENT.
                          body_text:
                            type: array
                            items:
                              type: array
                              items:
                                type: string
                            description: >-
                              Exemplos das variáveis do corpo. Gerados
                              automaticamente quando omitidos.
                        additionalProperties: true
                        description: Exemplos exigidos pela Meta para aprovar o template.
                      buttons:
                        type: array
                        items:
                          anyOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - QUICK_REPLY
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 25
                                  description: Rótulo do botão (até 25 caracteres).
                              required:
                                - type
                                - text
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - URL
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 25
                                  description: Rótulo do botão (até 25 caracteres).
                                url:
                                  type: string
                                  format: uri
                                  description: >-
                                    URL de destino. Pode conter a variável {{1}}
                                    no final do caminho.
                                example:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    Exemplos de URL completa quando a URL contém
                                    variável.
                              required:
                                - type
                                - text
                                - url
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - PHONE_NUMBER
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 25
                                  description: Rótulo do botão (até 25 caracteres).
                                phone_number:
                                  type: string
                                  minLength: 8
                                  description: >-
                                    Telefone no formato internacional, ex.:
                                    +5511999999999.
                              required:
                                - type
                                - text
                                - phone_number
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - OTP
                                otp_type:
                                  type: string
                                  enum:
                                    - COPY_CODE
                                    - ONE_TAP
                                  description: >-
                                    Forma de entrega do código: copiar código ou
                                    toque único.
                                text:
                                  type: string
                                  minLength: 1
                                  maxLength: 25
                                  description: Rótulo do botão (até 25 caracteres).
                              required:
                                - type
                                - otp_type
                                - text
                              additionalProperties: false
                          description: >-
                            Botão do template. QUICK_REPLY não pode ser
                            combinado com URL/PHONE_NUMBER na mesma mensagem.
                        description: >-
                          Botões do componente BUTTONS. Máximo de 3 QUICK_REPLY
                          ou 2 URL/PHONE_NUMBER.
                      add_security_recommendation:
                        type: boolean
                        description: >-
                          Adiciona o aviso de segurança padrão. Somente em
                          templates AUTHENTICATION.
                      code_expiration_minutes:
                        type: integer
                        minimum: 1
                        maximum: 90
                        description: >-
                          Validade do código OTP em minutos (1 a 90). Somente em
                          AUTHENTICATION.
                    required:
                      - type
                    additionalProperties: false
                  minItems: 1
                  description: >-
                    Nova lista de componentes. Substitui integralmente a
                    anterior.
              required:
                - components
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID do template na Meta.
                  status:
                    type: string
                    description: Status inicial atribuído pela Meta, normalmente PENDING.
                  category:
                    type: string
                    description: Categoria confirmada pela Meta.
                  success:
                    type: boolean
                    description: Indica sucesso em operações de exclusão.
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  statusCode:
                    type: number
                  details: {}
                required:
                  - message
                  - statusCode
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  statusCode:
                    type: number
                  details: {}
                required:
                  - message
                  - statusCode
                additionalProperties: false
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-jurichat-api-key
      description: >-
        Chave de API do escritório (criada no painel). Envie o valor no header
        x-jurichat-api-key.

````