> ## Documentation Index
> Fetch the complete documentation index at: https://cpaas.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /v1/channels/whatsapp/templates/{template_id}

> Change a WhatsApp template's body, footer or category.

Changes a template's body, footer or category. WhatsApp reviews every edit: the template is `pending`, and can't be sent, until it is approved again.

> [!NOTE]
>
> Needs the `whatsapp.templates:write` scope.

## Path parameters

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `template_id` | string | Yes | The template's id, from the list. |

## Body

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `body` | string | Yes | The new text, up to 1024 characters. |
| `footer` | string | No | Up to 60 characters. |
| `category` | string | No | `utility`, `marketing` or `authentication`. |

## Request

```bash cURL theme={null}
curl -X PATCH https://api.fireflo.au/v1/channels/whatsapp/templates/1029384756473829 \
  -H "Authorization: Bearer $OMNI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Hi {{1}}, order {{2}} is on its way.",
    "footer": "Acme Retail"
  }'
```

```python Python theme={null}
import os

import requests

response = requests.patch(
    "https://api.fireflo.au/v1/channels/whatsapp/templates/1029384756473829",
    headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
    json={
        "body": "Hi {{1}}, order {{2}} is on its way.",
        "footer": "Acme Retail",
    },
)
print(response.status_code, response.json())
```

```javascript Node theme={null}
const response = await fetch("https://api.fireflo.au/v1/channels/whatsapp/templates/1029384756473829", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "body": "Hi {{1}}, order {{2}} is on its way.",
    "footer": "Acme Retail"
  }),
});
console.log(response.status, await response.json());
```

## Response

`200 OK` — the template, `pending` again.

```json theme={null}
{
  "id": "1029384756473829",
  "name": "order_shipped",
  "language": "en",
  "status": "pending",
  "category": "utility",
  "components": [
    {
      "type": "BODY",
      "text": "Hi {{1}}, order {{2}} is on its way."
    },
    {
      "type": "FOOTER",
      "text": "Acme Retail"
    }
  ],
  "reason": ""
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `not_found` | No template has that id on this account. |
| 400 | `invalid_request` | `body` is missing or over 1024 characters (`field` is `body`). |
| 404 | `channel_off` | The account doesn't have WhatsApp on. |
| 409 | `provider_refused` | WhatsApp refused it; the message gives WhatsApp's reason. |
| 400 | `invalid_json` | The body isn't valid JSON. |
| 403 | `scope_missing` | The key doesn't have the `whatsapp.templates:write` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](https://cpaas.fireflo.au/api-reference/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.