Skip to content

Edit, Duplicate or Send a Template by API

Edit a WhatsApp template in LeadPattern or by API within Meta's limits, duplicate it into a new template, and copy a ready-made send request.

6 min readUpdated Dec 4, 2026

Each row in Templates has a menu with Preview, Edit, Duplicate, Send via API and Delete. This guide covers the middle three, plus editing a template from your own system with the API.

Edit a template

1

Open the row menu

In Templates, find the template and click Edit. If the button is greyed out, hover it to see why (see the table below).

2

Change the content

Update the text, examples, footer or buttons, then click Update Template on the last step.

3

Wait for review

The template goes back to pending while Meta reviews the edit. The status in the list updates on its own when Meta responds, so there's no need to refresh.

What WhatsApp allows

StatusCan you edit?LimitsWhat can change
ApprovedYes1 edit per 24 hours, 10 per 30 daysText, examples, footer, button labels and links. Header type and the number and types of buttons stay the same. Category can't change.
RejectedYesNoneEverything except name and language, including header type and buttons. Category can switch between Marketing and Utility.
PausedYesNoneSame as rejected.
Pending / in appealNo—Wait for Meta's decision.
DisabledNo—Duplicate it instead.

Duplicate a template

Duplicate opens the create form filled in with the template's content, under the name <name>_copy. Change the name or language, adjust anything else, and submit it.

The copy is a new template. It goes through Meta review on its own, and the original isn't changed. Use it to:

  • make the same message in another language (same name, different language works too)
  • start from a template you can't edit (pending, disabled, or over its edit limit)
  • try a variation without touching an approved template

Send a template through the API

For an approved template, Send via API shows a ready-made request in cURL, Node.js and Python, already filled in with the template's name, language, variables, header media and buttons. Copy it, then replace YOUR_API_KEY, the phone number and the sample values.

  • Templates with named variables ({{customer_name}}) use POST /v2/whatsapp/message/template, where each value is sent with its name.
  • Templates with numbered variables ({{1}}) use POST /whatsapp/message/template, where values are sent in order.
  • Authentication (OTP) templates use POST /whatsapp/message/auth-template and only need the code.

Create an API key under Developer → API Keys.

Edit a template through the API

Use PUT /template/:name to edit a template from your own system. The same rules as in the app apply.

1

Send the whole template

The components you send replace the current ones. Always send the full header, body, footer and buttons, not only the part you changed.

2

Include real examples

Give a sample value for every variable. Meta's reviewers see them, and placeholder samples are a common reason for rejection.

3

Watch the status

The response says PENDING. Check GET /template/:name/status, or listen for the template_updated webhook event, to know when Meta approves or rejects the edit.

BASH / CURL
1curl -X PUT https://public.leadpattern.com/template/order_shipped \
2 -H "Authorization: YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "components": {
6 "header": { "format": "TEXT", "text": "Order {{order_id}} update", "example": "ORD-1234" },
7 "body": {
8 "text": "Hi {{customer_name}}, your order {{order_id}} has shipped and arrives on {{delivery_date}}.",
9 "example": { "customer_name": "John", "order_id": "ORD-1234", "delivery_date": "12 March" }
10 },
11 "footer": { "text": "Reply STOP to opt out" },
12 "buttons": [
13 { "type": "URL", "text": "Track order", "url": "https://example.com/track/{{order_id}}", "example": "ORD-1234" },
14 { "type": "PHONE_NUMBER", "text": "Call us", "phoneNumber": "+15550100100" }
15 ]
16 }
17 }'

A few details:

  • Media headers: for an IMAGE, VIDEO or DOCUMENT header, send { "format": "IMAGE", "mediaUrl": "https://…/sample.jpg" }. LeadPattern uploads the sample to Meta for review; you pass the real media each time you send.
  • Variable names use letters, digits and underscores. They're stored lowercase with underscores: {{CustomerName}} becomes {{customer_name}}, and {{1}} becomes {{var_1}}.
  • Dynamic links: a URL button can end with one variable, such as https://example.com/track/{{order_id}}. Give its sample in the button's example.
  • Category: add "category": "UTILITY" (or "MARKETING") only for a rejected or paused template.
  • Authentication (OTP) and carousel templates can't be edited through the API. Edit them in LeadPattern.

Errors you may see

StatusMeaning
400The template can't be edited in its current status, or the request tries to change something WhatsApp keeps fixed (language, an approved template's category, header type or buttons). The message says which.
404No template with that name.
409WhatsApp refused the edit, usually because the template's status changed on Meta. Check its status and try again, or duplicate it.
429An approved template's edit limit (1 per 24 hours or 10 per 30 days) is reached.

The full field list and more examples are in the API reference.

Was this article helpful?

Your feedback helps us continuously improve our documentation.

Need more help with this topic?Ask LeadPattern Support

Related Articles