Important — delete by name, not ID: The WhatsApp Cloud API deletes templates by name, not by template ID. Deleting a template by name removes all language variants of that template simultaneously. Plan accordingly in multi-language deployments.
30-day name lock: After deletion, the template name cannot be reused for 30 days. If you need a replacement template quickly, use a new name.
When to Use
- Retired campaign cleanup: An end-of-year cleanup workflow deletes obsolete promotional templates (e.g.
black_friday_2023) that are no longer needed, reducing clutter in the template library.
- Rejected template removal: After a template is rejected by Meta and the content cannot be salvaged, a workflow deletes it and creates a replacement with corrected content under a new name.
- Multi-tenant offboarding: When a tenant cancels their subscription, an offboarding workflow deletes all WhatsApp templates associated with their business account as part of data cleanup.
- Duplicate template cleanup: A template audit discovers multiple templates with similar names. A deduplication workflow deletes the redundant ones and updates all references to point to the canonical template.
- Test template disposal: A development/staging environment creates test templates. A post-deployment cleanup workflow deletes them before they count against the production template limit.
Configuration
Connection
| Field | Required | Description |
accessToken | Required | Permanent System User access token with whatsapp_business_management permission. Store in BizFirst Credentials Manager. |
phoneNumberId | Required | WhatsApp Business phone number ID associated with the account owning the template. |
apiVersion | Optional | Meta Graph API version, e.g. v18.0. Defaults to v18.0. |
Operation
| Field | Required | Description |
templateName | Required | The exact name of the template to delete (e.g. order_confirmation_v1). This deletes ALL language variants of this template name. The name is URL-escaped automatically by the node. |
Sample Configuration
{
"resource": "template",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"templateName": "black_friday_2023"
}
Validation Errors
| Error | Cause |
accessToken is required | The accessToken field is empty or missing. |
phoneNumberId is required | The phoneNumberId field is empty or missing. |
templateName is required | The templateName field is empty or missing. |
100 (Meta) | Template name not found in the business account, or the token does not have access to this account. |
190 (Meta) | Access token expired or invalid. |
200 (Meta) | Token lacks whatsapp_business_management permission scope. |
Output
Success Port
Fires when Meta confirms the template has been deleted.
| Field | Type | Description |
status | string | "deleted" on success. |
errorCode | string | Empty on success. |
errorMessage | string | Empty on success. |
rawResponse | string | Raw JSON from Meta, typically {"success":true}. |
Error Port
| Field | Type | Description |
status | string | "failed" or "error". |
errorCode | string | Meta error code or BizFirst internal code. |
errorMessage | string | Human-readable description of the failure. |
rawResponse | string | Raw API error JSON for diagnostics. |
Sample Output
{
"status": "deleted",
"errorCode": null,
"errorMessage": null,
"rawResponse": "{\"success\":true}"
}
Expression Reference
| Value | Expression | Notes |
| Status | {{ $output.deleteTemplate.status }} | "deleted" on success. Use in an IfCondition to confirm before updating internal records. |
| Error code | {{ $output.deleteTemplate.errorCode }} | Code 100 indicates the template did not exist — treat as success in idempotent cleanup workflows. |
| Error message | {{ $output.deleteTemplate.errorMessage }} | Human-readable reason for failure. |
| Raw response | {{ $output.deleteTemplate.rawResponse }} | Meta confirmation JSON. |
Node Policies & GuardRails
| Policy Area | Recommendation |
| Archive before delete | Always retrieve and store the full template definition via template/get before deletion. Reconstruct in the future requires re-creation and re-approval. |
| Multi-language impact | Deletion removes ALL language variants for the template name. Verify all language variants are safe to delete before proceeding. |
| 30-day name lock | The deleted name cannot be reused for 30 days. If the template needs to be recreated quickly, use a versioned name (e.g. order_confirmation_v2). |
| Active campaign check | Before deleting, confirm no active workflow is currently using this template in a send operation. Check internal configuration tables for references. |
| Error port — idempotency | In bulk cleanup workflows, treat error code 100 (not found) as a success condition — the template was already deleted. |
| Audit logging | Log the template name, all language variants, and the triggering user/workflow before deletion. This is required for compliance traceability. |
Examples
Post-Campaign Cleanup
{
"resource": "template",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"templateName": "{{ $loop.currentItem.templateName }}"
}
An end-of-campaign cleanup workflow loops through a list of expired campaign template names. For each name, it first calls template/get to retrieve and archive the definition, then calls this node to delete. The workflow logs all deletions and handles 100 errors as already-deleted without alerting.
Tenant Offboarding
{
"resource": "template",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "{{ $input.tenantPhoneNumberId }}",
"templateName": "{{ $loop.currentItem }}"
}
An offboarding workflow queries all template names registered by the departing tenant, iterates through the list, and calls this node for each. All deletions are logged in the offboarding audit report sent to the compliance team on completion.
Rejected Template Removal and Replacement
// Step 1: Delete the rejected template
{
"resource": "template",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"templateName": "promo_spring_rejected"
}
// Step 2 (after delete success): Create replacement with corrected name
{
"resource": "template",
"operation": "create",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"name": "promo_spring_v2",
"language": "en_US",
"category": "MARKETING",
"components": "{{ $input.correctedComponentsJson }}"
}
A rejected template is deleted and immediately replaced with a corrected version under a new name (since the original name is locked for 30 days). The workflow notifies the marketing team with the new template ID and expected approval timeline.