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

# Edit template

> Edit an existing template and resubmit for approval

## Overview

Edits an existing template and resubmits it for Meta approval. The body is the same used when creating the template.

<Warning>
  When editing an approved template, it goes back to `PENDING` status until Meta reviews it again.
</Warning>

<Note>
  The `templateId` is obtained from the [List templates](/en/templates/list-templates) endpoint.
</Note>


## OpenAPI

````yaml en/templates/openapi.json PUT /whatsapp/businesses/{wabaId}/templates/{templateId}
openapi: 3.1.0
info:
  title: Hub Message - Templates API
  description: API for managing WhatsApp Business message templates
  version: 1.0.0
servers:
  - url: https://api.hubmessage.io
security:
  - bearerAuth: []
paths:
  /whatsapp/businesses/{wabaId}/templates/{templateId}:
    put:
      tags:
        - Templates
      summary: Edit template
      description: Edits an existing template and resubmits it for Meta approval.
      operationId: updateTemplate
      parameters:
        - name: wabaId
          in: path
          required: true
          description: WABA ID (obtained via List WABAs)
          schema:
            type: string
            example: '428083093730937'
        - name: templateId
          in: path
          required: true
          description: Template ID (obtained via List templates)
          schema:
            type: string
            example: '1900296177408890'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplateRequest'
            example:
              name: order_update_v1
              category: UTILITY
              language: en_US
              components:
                - type: BODY
                  text: Hello {{1}}, your order {{2}} has been updated to {{3}}.
                  example:
                    body_text:
                      - - Ana
                        - ORD-1024
                        - in transit
      responses:
        '200':
          description: Template edited successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
              example:
                success: true
        '400':
          $ref: '#/components/responses/MetaError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreateTemplateRequest:
      type: object
      required:
        - name
        - category
        - language
        - components
      properties:
        name:
          type: string
          description: Template name (snake_case, no spaces)
        category:
          type: string
          description: Template category
          enum:
            - UTILITY
            - MARKETING
            - AUTHENTICATION
        language:
          type: string
          description: Template language (e.g. en_US, pt_BR)
        components:
          type: array
          description: Template components (HEADER, BODY, FOOTER, BUTTONS)
          items:
            type: object
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates whether the operation was successful
    MetaError:
      type: object
      properties:
        error:
          type: string
          description: General error description
        value:
          type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  description:
                    type: string
                  name:
                    type: string
                    description: Error type (e.g. META_WHATSAPP_ERROR)
                  message:
                    type: string
                    description: Meta error message
                  code:
                    type: string
                    description: Meta error code
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error description
  responses:
    MetaError:
      description: Error returned by Meta when processing the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MetaError'
          example:
            error: Newport request failed
            value:
              errors:
                - description: ''
                  name: META_WHATSAPP_ERROR
                  message: >-
                    Your message could not be sent because it contains content
                    that other people on Facebook have reported as abusive.
                  code: '368'
    Unauthorized:
      description: Invalid or missing token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generated in the Hub Message Security panel

````