---
title: "Update template by id"
method: PATCH
path: "/v1/messaging/whatsapp/templates/id/{templateId}"
tags: ["WhatsApp"]
---

# Update template by id

`PATCH /v1/messaging/whatsapp/templates/id/{templateId}`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/messaging/whatsapp/templates/id/{templateId}`
- Auth: HTTP bearer

Update one variant's components and/or its message_send_ttl_seconds by its Meta id. Name, language and category cannot change.

Meta only allows editing templates in `APPROVED`, `REJECTED` or `PAUSED` state; an approved
template can be edited once per 24 hours and up to 10 times per 30 days. A component update
sends the variant back to Meta for review, so the `status` returned here is normally `PENDING`;
a TTL-only update keeps an APPROVED variant approved.
The final outcome arrives on the `whatsapp.template.status_updated` webhook (which carries the
variant's `templateId` and `language`). A variant already in `PENDING` cannot be edited again
until Meta finishes reviewing it.


**Billing:** Request; paid actions are priced in credits (see GET /v1/messaging/prices) · **Rate limit:** 60/min

## Path parameters

- `templateId` string, required: Meta template id (numeric).

## Headers

- `Idempotency-Key` string
- `X-Tag` string

## Request body

- object
  - `accountId` string, required: WhatsApp account ID
  - `components` union[]: Updated template components. Optional when only message_send_ttl_seconds changes; at least one of the two is required.
    - union
      - object
        - `text` string: Header text (may include {{1}} variable). Used when format is TEXT.
        - `type` 'header', required
        - `format` 'text' | 'image' | 'video' | 'gif' | 'document' | 'location', required
      - object
        - `text` string, required: Body text with optional {{n}} variables
        - `type` 'body', required
        - `add_security_recommendation` boolean: Add security recommendation text (authentication templates only)
      - object
        - `text` string: Static footer text
        - `type` 'footer', required
        - `code_expiration_minutes` integer: OTP code expiry in minutes (authentication templates only)
      - object
        - `type` 'buttons', required
        - `buttons` object[], required
          - `url` string, uri: Required when type is URL
          - `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).
          - `type` 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'copy_code' | 'flow' | 'mpm' | 'catalog', required
          - `flow_id` string
          - `otp_type` 'copy_code' | 'one_tap' | 'zero_tap': Required when type is otp
          - `flow_json` string
          - `flow_name` string
          - `flow_action` string
          - `package_name` string
          - `phone_number` string: Required when type is phone_number
          - `autofill_text` string
          - `signature_hash` string
          - `navigate_screen` string
      - object
        - `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` union[], 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
              - …
      - object
        - `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.
  - `message_send_ttl_seconds` integer: Delivery validity window in seconds: a message not delivered within it is dropped. Range depends on category: AUTHENTICATION 30 to 900, UTILITY 30 to 43200 (12h), MARKETING 43200 to 2592000 (30 days); -1 is not accepted here (Meta treats it as an empty edit); send a value in range. A TTL-only edit keeps an APPROVED template approved, no re-review. Meta defaults to 600 for AUTHENTICATION and 30 days otherwise. If Meta later recategorises the template, it clears the TTL (read it back to check).

## Response `200`

Completed

- object
  - `id` string: Execution id — stable across internal retries; use it with GET /v1/executions/{id}
  - `status` 'pending' | 'processing' | 'completed' | 'partial' | 'failed' | 'cancelled' | 'timeout'
  - `operation` string
  - `tag` string, nullable: Your X-Tag, if sent
  - `created_at` string, date-time
  - `completed_at` string, date-time, nullable
  - `output` object: Operation result (see each operation). While a Studio render is processing: `stage` (queued · transcribing · downloading · preparing · cleaning_voice · mixing_audio · rendering · finishing), `phase` (the engine's: download · prepare · voice · audio · encode · qa · upload, or null), `progress` (a percent, 0–100) and `progress_fraction` (0–1), `eta_seconds` (seconds left, never below 0) and `estimate_seconds`
    - `success` boolean
    - `template` object
      - `id` string
      - `name` string
      - `status` string: Approval state read back from Meta after the update, normally PENDING. If the state cannot be read back, the last known status is returned instead.
      - `language` string
  - `error` string, nullable
  - `usage` object
    - `credits_charged` number, nullable
    - `credits_reserved` number
    - `estimated_credits` number
    - `cost_source` 'provider_reported' | 'calculated' | 'estimated' | 'null', nullable
    - `provider_usage` object, nullable: Normalised consumption, e.g. { VIDEO_SECOND: 22.4 }
  - `balance` object
    - `available` number
    - `reserved` number

## Other responses

- `400`: Invalid input
- `402`: Insufficient credits / project budget
- `404`: Resource not found (or not yours)
- `429`: Rate limited
- `503`: Service temporarily paused

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
