Skip to main content

Delete a message

This endpoint will let you delete a message from 2Chat and from WhatsApp if the message was sent up to 15 days ago.

Parameters

These are path parameters that should go in the URL you use to invoke the endpoint.

ParameterDescriptionExample
Session KeyThe session key the message belongs toWW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us
Message UUIDThe UUID of the message you want information fromMSG205dec10-523d-4ab3-b739-fd56e7cdeba2

Deleting a message you sent in a conversation

Assuming you want to delete a message you sent that has MSG205dec10-523d-4ab3-b739-fd56e7cdeba2 as UUID, and is part of the conversation with session key WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us. To delete it, you must make a DELETE request to:

https://api.p.2chat.io/open/whatsapp/message/WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us/MSG205dec10-523d-4ab3-b739-fd56e7cdeba2.

caution

WhatsApp will only let you delete messages up to 15 days after you sent them

Invocation

curl --location --request DELETE 'https://api.p.2chat.io/open/whatsapp/message/WW-WPN66037eca-9ad1-4c96-9eff-526a90a48c77-5215511112222@c.us/MSG205dec10-523d-4ab3-b739-fd56e7cdeba2' \
--header 'X-User-API-Key: your_api_key_here' \
--data-raw ''

Response

{
"success": true,
"message_uuid": "MSG205dec10-523d-4ab3-b739-fd56e7cdeba2",
"whatsapp_message_id": "3EB0AFC0D8DFCFAB08A4FB"
}