Edit a WhatsApp template
update_whatsapp_templateEdit a WhatsApp template
Replaces the template's content, as Meta's edit does: send all of it, as for
createWhatsAppTemplate, with the same rules. The name and language never change. Leave
category out to keep it; Meta lets only a rejected or paused template change category.
A media header sent without media_url keeps its current sample; one whose format changes
needs media_url (422 template_rejected without it). A change Meta wouldn't
take, such as an approved template's category or a switch between numbered and named
variables, is 422 template_rejected before it reaches Meta. Only an approved,
rejected or paused template can be edited (409 template_status_not_allowed), and Meta
allows an approved one an edit a day and ten a month (409 template_edit_limit_reached).
Content that equals what Meta holds isn't sent and spends no edit, except that an
authentication template, message_send_ttl_seconds or a new media_url always counts as a
change, since Meta's list doesn't show them to compare. Meta reviews every
change: follow it with getWhatsAppTemplate. A template a broadcast is sending right now is
409 template_in_use_by_broadcast. It finds templates among the first 100 the list reads.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| otp | No | An authentication template's code button. A send passes the code as `otp_code` (and as the body's `{{1}}`). | |
| body | No | ||
| footer | No | ||
| header | No | ||
| buttons | No | ||
| agent_id | Yes | The agent the resource belongs to. Another company's agent, or the nil UUID, is `404 agent_not_found`; an agent outside the key's agent list is `403 agent_not_authorized`. | |
| category | No | Leave it out to keep the template's category. Meta changes it only on a rejected or paused template. | |
| template_id | Yes | A template's `id` from `listWhatsAppTemplates`: one language version. One that isn't among the number's templates is `404 not_found`. | |
| body_examples | No | ||
| connection_id | Yes | A connection of the agent. Another agent's connection is `404 not_found`. | |
| message_send_ttl_seconds | No | Left out, the template keeps its own. |