---
title: "Update template"
method: PATCH
path: "/v1/whatsapp/templates/{templateName}"
tags: ["WhatsApp"]
---

# Update template

`PATCH /v1/whatsapp/templates/{templateName}`

Update a message template's components. Only certain fields can be updated depending on
the template's current approval state. Approved templates can only have components updated.

## Path parameters

- `templateName` string, required

## Request body

- object
  - `accountId` string, required — WhatsApp social account ID
  - `components` WhatsAppTemplateComponent[], required — Updated template components
    - union
      - WhatsAppHeaderComponent
        - `type` 'header', required
        - `format` 'text' | 'image' | 'video' | 'gif' | 'document' | 'location', required
        - `text` string — Header text (may include {{1}} variable). Used when format is TEXT.
        - `example` object
          - `header_text` string[] — Sample values for header text variables
          - `header_text_named_params` WhatsAppNamedParamExample[] — Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).
            - `param_name` string, required — Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).
            - `example` string, required — Sample value for this variable.
          - `header_handle` string[] — When the header format is a media type (image, video, gif, document), provide a public URL here. Zernio will download and upload it to WhatsApp on your behalf, replacing it with the internal file handle before creating the template.
      - WhatsAppBodyComponent
        - `type` 'body', required
        - `text` string, required — Body text with optional {{n}} variables
        - `add_security_recommendation` boolean — Add security recommendation text (authentication templates only)
        - `example` object
          - `body_text` array[] — Sample values for body variables (array of arrays)
            - string[]
          - `body_text_named_params` WhatsAppNamedParamExample[] — Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).
            - `param_name` string, required — Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).
            - `example` string, required — Sample value for this variable.
      - WhatsAppFooterComponent
        - `type` 'footer', required
        - `text` string — Static footer text
        - `code_expiration_minutes` integer — OTP code expiry in minutes (authentication templates only)
      - WhatsAppButtonsComponent
        - `type` 'buttons', required
        - `buttons` WhatsAppTemplateButton[], required
          - `type` 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog', required
          - `text` string — Visible button label. Required for all types except copy_code (whose label is fixed by WhatsApp) and otp (omit it and WhatsApp supplies its own label, localized to the template language; an English label on a non-English template is rejected).
          - `url` string, uri — Required when type is URL
          - `example` unknown
          - `phone_number` string — Required when type is phone_number
          - `otp_type` 'copy_code' | 'one_tap' | 'zero_tap' — Required when type is otp
          - `autofill_text` string
          - `package_name` string
          - `signature_hash` string
          - `flow_id` string
          - `flow_name` string
          - `flow_json` string
          - `flow_action` string
          - `navigate_screen` string
      - WhatsAppCarouselComponent
        - `type` 'carousel', required
        - `cards` object[], required — 2-10 cards. Meta requires all cards to share the same component structure; a mismatch surfaces as a rejected_reason. MARKETING category only.
          - `components` WhatsAppCarouselCardComponent[], required — Per-card components. Each card carries its own media header + optional body + up to 2 buttons. Footer and nested carousel are not allowed inside cards.
            - union
              - …
      - WhatsAppLimitedTimeOfferComponent
        - `type` 'limited_time_offer', required
        - `limited_time_offer` object, required
          - `text` string, required — Short offer label (<=16 chars). MARKETING only.
          - `has_expiration` boolean — Toggles the countdown timer. The actual coupon code + expiry are bound at SEND time, not here.

## Response `200`

Template updated successfully

- object
  - `success` boolean
  - `template` object
    - `id` string
    - `name` string
    - `status` string

## Other responses

- `400` — Validation error (missing fields)
- `401` — Unauthorized
- `404` — Resource not found
- `502` — Meta rejected the update or was unreachable. Meta 4xx statuses are forwarded as-is.

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/51932b099b2f/schema)
