60-minute window: WhatsApp enforces a strict 60-minute time limit for deleting sent messages. After this window, deletion attempts are rejected by the Meta API. Always store the message ID and send timestamp if you need to support deletion workflows, and build time-validation logic before calling this operation.
When to Use
- Erroneous message retraction: A workflow that accidentally sent a message to the wrong recipient (e.g., due to a data mapping error) immediately triggers a deletion as part of the error recovery flow.
- Confidential data cleanup: A workflow that accidentally included sensitive data (an OTP, account number) in a free-form message immediately triggers deletion and sends a corrected message.
- Time-sensitive offer expiry: A flash sale workflow deletes an offer message when the sale ends, preventing customers from attempting to claim an expired deal hours later.
- Bot correction: A chatbot detects that it sent an incorrect answer due to a lookup failure, deletes the message within the 60-minute window, and sends a corrected response.
- Test message cleanup: A workflow testing environment deletes test messages sent to real phone numbers during QA to avoid cluttering customer conversations.
Configuration
Connection
| Field | Required | Description |
accessToken | Required | Permanent System User access token. Store in BizFirst Credentials Manager. |
phoneNumberId | Required | Numeric string ID of the sending phone number that originally sent the message. |
apiVersion | Optional | Meta Graph API version. Defaults to v18.0. |
Operation
| Field | Required | Description |
messageId | Required | The WhatsApp message ID (wamid) of the sent message to delete. Must be a message sent by this business phone number — you cannot delete messages sent by the other party. |
to | Required | The recipient's phone number (the conversation partner). Required by the Meta API to identify the conversation context. |
Sample Configuration
{
"resource": "message",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"messageId": "{{ $input.messageIdToDelete }}",
"to": "{{ $input.recipientPhone }}"
}
Pre-deletion time check: Always validate that the message is within the 60-minute deletion window before calling this operation. Use a Function node to compute now - sentAt < 3600 seconds. If outside the window, route to an error notification flow rather than attempting deletion.
Validation Errors
| Error | Cause |
accessToken is required | The accessToken field is empty. |
phoneNumberId is required | The phoneNumberId field is empty. |
messageId is required | The messageId field is empty. |
131026 (Meta) | Message ID not found or does not belong to this phone number's conversations. |
131000 (Meta) | Deletion window expired — the message is more than 60 minutes old. |
131047 (Meta) | Attempting to delete a message outside the 24-hour conversation window. |
Output
Success Port
| Field | Type | Description |
messageId | string | The wamid of the deleted message (echoed from input). |
status | string | "sent" on success (the deletion request was accepted by Meta). |
errorCode | string | Empty on success. |
errorMessage | string | Empty on success. |
rawResponse | string | Full raw JSON from the Meta API. |
Error Port
| Field | Type | Description |
status | string | "failed" or "error". |
errorCode | string | Meta error code or BizFirst validation code. |
errorMessage | string | Human-readable error description. |
rawResponse | string | Raw API error response. |
Sample Output
{
"messageId": "wamid.HBgLMTQxNTU1NTI2NzEVAgARGBIxQzM4NjhGQTExMjQ3RDMAA",
"status": "sent",
"errorCode": null,
"errorMessage": null,
"rawResponse": "{\"messaging_product\":\"whatsapp\",\"contacts\":[{\"input\":\"14155552671\",\"wa_id\":\"14155552671\"}],\"messages\":[{\"id\":\"wamid.HBgLMTQxNTU1NTI2NzEVAgARGBIxQzM4NjhGQTExMjQ3RDMAA\"}]}"
}
Expression Reference
| Value | Expression | Notes |
| Deleted message ID | {{ $output.deleteMsg.messageId }} | Echoed from input for confirmation logging. |
| Status | {{ $output.deleteMsg.status }} | Branch on "sent" (deletion accepted) vs "failed". |
| Error code | {{ $output.deleteMsg.errorCode }} | Check for 131000 to detect an expired deletion window specifically. |
Node Policies & GuardRails
| Policy Area | Recommendation |
| Credential storage | Store the access token in BizFirst Credentials Manager. Never inline in configuration. |
| Time window enforcement | Always check whether the message is within the 60-minute deletion window in a Function or IfCondition node before calling this operation. Expired deletion attempts waste API quota and return uninformative errors. |
| Store message IDs | Save the wamid and send timestamp for every outbound message in a database or VariableAssignment node if your workflow needs deletion capability. Without the stored wamid, deletion is impossible. |
| Cannot delete received messages | Only messages sent by the business phone number can be deleted. You cannot delete messages sent by the customer. Attempting to delete an inbound message ID returns a 131026 error. |
| Audit trail | Log all deletion operations with the operator identity, reason, original message content, and timestamp. Regulatory environments may require a record of what was sent and when it was deleted. |
| Error port | Connect the error port. Expired window (131000) and invalid message ID (131026) are common failure modes. Route to separate handling branches for each error type. |
Examples
Immediate Deletion on Wrong Recipient Error
{
"resource": "message",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"messageId": "{{ $output.sendMsg.messageId }}",
"to": "{{ $input.recipientPhone }}"
}
An error-recovery sub-workflow is triggered when a downstream validation step detects that a message was sent to the wrong phone number. This node is called within seconds of the erroneous send — well within the 60-minute window. A follow-up node sends an apology to the recipient, and a notification is sent to the compliance team.
Flash Sale Offer Retraction
{
"resource": "message",
"operation": "delete",
"accessToken": "{{ $credentials.whatsAppToken }}",
"phoneNumberId": "123456789012345",
"messageId": "{{ $input.offerMessageId }}",
"to": "{{ $input.customerPhone }}"
}
A ScheduledTrigger fires 55 minutes after a flash sale offer message was sent. A Loop node iterates over all recipients and calls this delete operation for each stored wamid. The messages are replaced with "This message was deleted" in each conversation, preventing late redemption attempts. Note: this pattern only works if the offer window is under 60 minutes.