---
docId: doc_accb944395ec4075bf8976c80f41fc60
title: Delete a template
description: "Delete all languages of a template or only the selected language."
api:
  group: mensajes/plantillas
  auth: bearer
  operations:
    - operationId: deleteWhatsAppTemplate
      method: DELETE
      path: '/v1/whatsapp/templates/{name}'
      postmanName: Delete a Template
---

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

# Delete a template

Delete a template at Meta. Without `language`, delete all its languages; with `language`, delete only that version. This cannot be undone.

<Note type="warning">

Scheduled messages and campaigns can no longer send the deleted template. Meta may temporarily reject a new template with the same name. See [Meta's template documentation](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates).

</Note>

## Example

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

```bash
curl -X DELETE "https://api.platic.ai/v1/whatsapp/templates/$TEMPLATE_NAME?language=es_MX" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

```ts
await platic.whatsapp.templates.delete("order_update", { language: "es_MX" });
```

</Ways.Way>
</Ways>

## Path parameters

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

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Workspace ID. Required if your credential covers several workspaces ([list workspaces](/api-reference/workspaces)); without it the answer is `400` | If the credential has several |
| `language` | string | Delete only this language version, such as `es_MX`. Without it all languages are deleted | — |
| `wabaId` | string | The template's WABA. Needed only if the same name exists in several WABAs of the workspace | — |

## Request body

None.

## Response

```json
{
  "status": "success",
  "message": "Template deleted successfully",
  "data": {
    "name": "order_update",
    "wabaId": "155512345678901",
    "workspaceId": "K7u9rQ2LmZx18BvC5tNd",
    "deleted": [
      { "id": "1234567890123456", "language": "es_MX" },
      { "id": "6543210987654321", "language": "en_US" }
    ]
  }
}
```

With `language`, `message` is `"Template version deleted successfully"` and `deleted` has only that version.

| Field | Description |
|-------|-------------|
| `name` | The deleted template |
| `wabaId`, `workspaceId` | Where it was |
| `deleted` | The deleted versions, with their Meta `id` and their `language` |

## Errors

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

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The name or `language` are not valid. `details.issues` says which |
| `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` | `WABA_REQUIRED` | The name exists in several WABAs of the workspace. `details.available` lists the ones that have it |
| `400` | `TEMPLATE_INVALID` | Meta rejected the deletion. `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 delete permission in Campaigns. Conversations does not grant permission to delete templates. The message is `Missing 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 deleting 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 deleted 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 |
| `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 template may or may not have been deleted: check it 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": 400,
  "error": "Bad Request - The request has validation errors",
  "details": {
    "code": "WABA_REQUIRED",
    "message": "Template \"order_update\" exists in 2 WhatsApp Business Accounts of this workspace. Send wabaId with one of them.",
    "available": ["155512345678901", "155598765432109"]
  }
}
```

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

</Collapsible>

## Notes

- 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.
