Update Template

Templates

Update Template

Edits a draft template. Send only the fields that change; the result is checked against the same rules as Create Template. Once a template has been sent for review WhatsApp has its text, so it can no longer be edited — create a new template instead. Changing name or language renames it. A build key may do this. The one exception is agentMaySend (whether an agent may send the template in a call or chat): it goes alone and needs a full key.

PATCH/templates/{name}

Path parameters

namestringrequired
The template's name: lowercase letters, numbers and underscores.

Query parameters

languagestring
The template's language code. Needed only when the name exists in more than one language; without it such a name is a 409 that lists them.

Headers

Katexs-Workspacestring
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.

Request body

namestring
A new name: lowercase letters, numbers and underscores only.
languagestring
A new language code WhatsApp templates support, such as en, en_US or hi.
categorystring
A new category. One of: utility, marketing, authentication.
bodystring
The new message, with {{1}}, {{2}} … for the blanks. Ignored for an authentication template.
samplesstring[]
One example per body blank, in order. Leave it out to keep the current examples.
headerobject | null
The line or media above the body. null means no header.
header.kindstringrequired
What the header is. One of: none, text, image, video, document.
header.textstring
A text header's words. Required for text; no placeholders.
header.mediaUrlstring (uri)
For image, video or document: an https link to an example file WhatsApp's reviewers can fetch. Required for those kinds.
footerstring | null
The new footer. null or "" removes it.
buttonsobject[] | null
The full new list of buttons, replacing the old one. null or [] removes them all.
authobject
An authentication template's settings. WhatsApp writes the message itself ("123456 is your verification code."), so these are all you choose.
auth.expiryMinutesinteger
How long the code is valid, shown as "Expires in 10 minutes." Default: 10. Range: 1–90.
auth.securityRecommendationboolean
Adds "For your security, do not share this code." Default: true.
auth.otpTypestring
copy_code: a button that copies the code. one_tap: fills it into your Android app, which needs supportedApps. One of: copy_code, one_tap. Default: copy_code.
auth.supportedAppsobject[]
Required for one_tap: the apps the code fills into.
agentMaySendboolean
Let an agent send this template during a call or chat, or stop it. Send it alone, not with other fields; it applies to every language of the name, only a Utility template whose link buttons are fixed can be allowed, and it needs a full key because it decides what an agent may message customers with.

Example request

bash
curl -X PATCH "https://app.katexs.com/api/v1/templates/{name}" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "body": "Hello {{1}}, your Kesar Naturals order {{2}} has been packed and will reach you within 3 days.",
  "samples": [
    "Priya",
    "#10432"
  ]
}'

Responses

StatusDescription
200Saved. The template as it now is.
400A field has the wrong type or an unknown value, or the body carries an offer or carousel. The message names the field.
401The key is missing, wrong or revoked. The answer is always the same, whichever it is.
403The key's access level (read-only or build) does not allow this request, the plan does not include it, or a customer's key named another workspace in Katexs-Workspace. code says which: key_scope_read, key_scope_build, workspace_header_forbidden, or forbidden.
404No template of that name (and language) in this workspace.
409The template is not a draft; or the name exists in more than one language and language was not given; or the new name and language are already taken.
410The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date.
422The edited template breaks one of WhatsApp's rules. The message says which.
429Over a per-minute limit. Wait for Retry-After seconds. code and limit say which limit: rate_limit_resources (240 requests a minute for the workspace), rate_limit_family (2,400 across a developer's customers), rate_limit_calls, rate_limit_messages, rate_limit_codes, rate_limit_code_recipient, concurrent_calls or number_daily_limit.

Response fields

namestringrequired
The template's name — what Send Message and Create Campaign take.
languagestringrequired
Its language code.
categorystringrequired
WhatsApp's category, which decides its price and its rules. One of: utility, marketing, authentication.
statusstringrequired
draft until submitted, pending while WhatsApp reviews it, then approved or rejected. WhatsApp may later pause an approved template that recipients flag. Only approved can be sent. One of: draft, pending, approved, rejected, paused.
agentstringrequired
The agent the template belongs to (ag_…).
bodystringrequired
The message, with {{1}}, {{2}} … for the blanks. For an authentication template, the sentence WhatsApp writes around the code.
variableCountintegerrequired
How many body values a send must carry, in order: the highest {{n}} in the body. Range: 0–.
variableLabelsobject[]required
The example given for each body blank.
buttonVariableCountintegerrequired
How many button values a send must carry: one per link button whose address ends in a blank. Range: 0–.
headerKindstringrequired
The header. image, video or document means a send must pass a media link for it. One of: none, text, image, video, document.
agentMaySendbooleanrequired
Whether an agent may send this template during a call or chat (its send_whatsapp tool). Only a Utility template with no blank in a link button can be. Every language of a name agrees. Change it with Update Template, sending agentMaySend alone.
createdAtstring (date-time)required
When it was created.
headerTextstring | nullrequired
A text header's words. null for any other header.
footerstringrequired
The footer line. Empty when there is none.
buttonsobject[]required
The template's buttons, in order.
reviewNotestring | nullrequired
Why WhatsApp refused it, when it did. null otherwise.
200 response
{
  "name": "order_ready",
  "language": "en",
  "category": "utility",
  "status": "draft",
  "agent": "ag_5c4a5f93-2b1e-4c0a-9d3f-7e8a1b2c3d4e",
  "body": "Hello {{1}}, your Kesar Naturals order {{2}} has been packed and will reach you within 3 days.",
  "variableCount": 2,
  "variableLabels": [
    {
      "position": 1,
      "sample": "Priya"
    },
    {
      "position": 2,
      "sample": "#10432"
    }
  ],
  "buttonVariableCount": 1,
  "headerKind": "none",
  "agentMaySend": false,
  "createdAt": "2026-10-06T10:00:01.874Z",
  "headerText": null,
  "footer": "Kesar Naturals, Jaipur",
  "buttons": [
    {
      "kind": "url",
      "label": "Track order",
      "url": "https://kesarnaturals.in/track/{{1}}"
    }
  ],
  "reviewNote": null
}

Last updated November 2026 · Found a problem? Email support@katexs.com