---
docId: doc_145bb896693e4250b98c4c84c129237f
title: Update a template
description: "Edit a template version and resubmit it for Meta review."
api:
  group: mensajes/plantillas
  auth: bearer
  operations:
    - operationId: updateWhatsAppTemplate
      method: PATCH
      path: '/v1/whatsapp/templates/{name}'
      postmanName: Update a Template
---

<script>
  import { Ways, Note, Collapsible } from '$lib/components';
</script>

# Update a template

Edit the components, category, or both for one language version. Meta reviews the edit, and the template cannot be sent until approved again.

If your credential covers several workspaces, add `?workspace=<id>` ([list workspaces](/api-reference/workspaces)); without it the answer is `400`.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/whatsapp/templates/$TEMPLATE_NAME \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "components": [
      {
        "type": "BODY",
        "text": "Your order {{1}} has shipped.",
        "example": { "body_text": [["1001"]] }
      }
    ]
  }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.whatsapp.templates.update("order_update", {
  components: [{ type: "BODY", text: "Your order {{1}} has shipped.", example: { body_text: [["1001"]] } }],
});
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `name` | string | Exact name of the template | ✓ |

## Request body

Send `components`, `category` or both.

```json
{
  "language": "es_MX",
  "components": [
    {
      "type": "BODY",
      "text": "Hi {{1}}, your order {{2}} is waiting for you at the store.",
      "example": { "body_text": [["Ana", "A-1024"]] }
    },
    { "type": "FOOTER", "text": "Acme" }
  ]
}
```

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `components` | array | — | All the components, from 1 to 20, in the format of [create a template](/api-reference/whatsapp-templates/create#components). They replace the current ones |
| `category` | string | — | New category: `MARKETING`, `UTILITY` or `AUTHENTICATION` |
| `language` | string | — | The language version to edit, such as `es_MX`. Needed if the template exists in several languages |
| `wabaId` | string | — | The template's WABA. Needed only if the same name exists in several WABAs of the workspace |

You can also send `language` and `wabaId` in the query (`?language=`, `?wabaId=`). If the query and body both include them, the body takes priority. `language` selects a version; it does not change its language.

### Change only the category

Send `category` alone to reuse the current components. For authentication templates, carousels, or image, video, or document headers, send `components` too. Omitting them returns `400 COMPONENTS_REQUIRED`.

## Response

```json
{
  "status": "success",
  "message": "Template updated and sent back to Meta's review",
  "data": {
    "name": "order_update",
    "category": "UTILITY",
    "status": "PENDING",
    "language": "es_MX",
    "components": [
      {
        "type": "BODY",
        "text": "Hi {{1}}, your order {{2}} is waiting for you at the store.",
        "example": { "body_text": [["Ana", "A-1024"]] }
      },
      { "type": "FOOTER", "text": "Acme" }
    ],
    "source": "meta",
    "content": "Hi {{1}}, your order {{2}} is waiting for you at the store.",
    "params": ["Ana", "A-1024"],
    "header": { "type": "none", "requiresMedia": false },
    "footer": "Acme",
    "buttons": [],
    "id": "1234567890123456",
    "api_example": {
      "name": "order_update",
      "params": ["Ana", "A-1024"]
    },
    "dynamicButtonsCount": 0,
    "wabaId": "155512345678901",
    "workspaceId": "K7u9rQ2LmZx18BvC5tNd",
    "nextStep": "The edit goes back to Meta's review; the template cannot be sent until it is APPROVED again. Check its status with GET /v1/whatsapp/templates/order_update and, once it is APPROVED, send it with POST /v1/messages/template."
  }
}
```

`data` is the updated version from Meta, with the fields from [create a template](/api-reference/whatsapp-templates/create#response). If Platica cannot read it after the change, it returns the previous version with the values you sent.

## Errors

<Collapsible summary="Show error codes and fixes">

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The name or the body is not valid, the body has an unknown field, or it has neither `components` nor `category`. `details.issues` says what |
| `400` | `INVALID_REQUEST` | Your credential covers several workspaces and you did not send `?workspace=`, or you sent one it does not cover. `details.available` has the IDs you can use |
| `400` | `TEMPLATE_LANGUAGE_REQUIRED` | The template exists in several languages and you did not send `language`. `details.languages` lists them |
| `400` | `COMPONENTS_REQUIRED` | You changed only `category` on a template whose components cannot be resent. Send `components` too |
| `400` | `WABA_REQUIRED` | The name exists in several WABAs of the workspace. `details.available` lists the ones that have it |
| `400` | `TEMPLATE_INVALID` | Meta or Platica rejected the edit. `details.message` has the reason |
| `401` | `UNAUTHENTICATED` | The credential is missing or not valid |
| `403` | `FORBIDDEN` | An OAuth token without the `platica:write` scope, or the person has no write permission in Conversations or Campaigns. The message is `Missing conversations or campaigns permission` |
| `404` | `TEMPLATE_NOT_FOUND` | No template has that name, or it does not have that language. In the second case `details.languages` lists the ones it has |
| `404` | `NOT_FOUND` | Meta did not find the template when editing it |
| `404` | `WORKSPACE_NOT_FOUND` | The workspace does not exist |
| `404` | `WABA_NOT_FOUND` | The workspace has no connected WABA, or `wabaId` is not one of its own. `details.available` lists the ones it has |
| `409` | `LEGACY_PROVIDER` | The workspace sends WhatsApp through MessageBird. Its templates are edited in MessageBird |
| `409` | `WHATSAPP_TOKEN_INVALID` | The WABA's access token expired or was revoked, or Platica has none that works. Reconnect the account in Platica |
| `409` | `WHATSAPP_PERMISSION_DENIED` | The WABA's token is missing a permission. Reconnect the account accepting all the WhatsApp permissions and check in Meta Business Manager that the app still has access to the WABA |
| `409` | `WHATSAPP_ACCOUNT_RESTRICTED` | Meta restricted the WABA. Check its status in WhatsApp Manager |
| `409` | `TEMPLATE_NOT_EDITABLE` | Meta does not let you edit the version in its current status (`PENDING`, `IN_APPEAL`, `DISABLED`…): only `APPROVED`, `REJECTED` or `PAUSED` ones can be edited. `details.status` says which one it is in, if known |
| `429` | `RATE_LIMITED` | WhatsApp is rate limiting the account's template requests. Wait a few minutes and try again |
| `502` | `UPSTREAM_ERROR` | Platica could not reach WhatsApp. Try again in a moment |
| `503` | `TEMPORARILY_UNAVAILABLE` | Platica could not read the workspace or its WABAs. Try again in a moment |
| `504` | `UPSTREAM_TIMEOUT` | WhatsApp did not answer in time. The edit may or may not have been applied: check the template with [get a template](/api-reference/whatsapp-templates/get) before trying again |

For `WHATSAPP_TOKEN_INVALID`, `WHATSAPP_PERMISSION_DENIED`, `WHATSAPP_ACCOUNT_RESTRICTED`, or `RATE_LIMITED`, check the WhatsApp account. `details.metaCode` contains Meta's code when available; `details.upstreamMessage` contains its message. Editing the template does not resolve these errors. `UPSTREAM_ERROR` may also include `details.upstreamMessage`.

```json
{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "TEMPLATE_NOT_EDITABLE",
    "message": "This template cannot be edited while it is PENDING: Meta only lets you edit templates that are APPROVED, REJECTED or PAUSED.",
    "status": "PENDING"
  }
}
```

The general error format is in [Errors](/api-reference/errors).

<Note type="warning">

Meta decides when and how many times a template can be edited. If it does not allow it, it answers `400 TEMPLATE_INVALID` with Meta's message. The rules are in [Meta's template documentation](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates).

</Note>

</Collapsible>

## Notes

- While Meta reviews the edit, the template cannot be sent. The [`template.status.updated`](/api-reference/webhooks/payloads#whatsapp-templates) event tells you when Meta decides; you can also check its status with [get a template](/api-reference/whatsapp-templates/get).
- If the workspace has several WABAs and you do not send `wabaId`, Platica looks for the name in all of them and uses the only one that has it.
