LetsBot Menu
Get Started English Language

Meta Business Partner UK Registered Company

Language

Messages · API endpoint

DELETE /api/v1/message/delete

Delete message by Id

You can delete message for phone number.

You can delete message for phone number. You need to send the message id. Id of the message in the key of the data of the response. In the data of the response you can see many options of the message (id, body, messageType, fileName if exist, author, chatName, time in timestamp format, status, etc).

Query parameters

ParameterRequiredExampleDescription
phone Yes {{phone}}
messageID Yes BAE509D204172AC0

Form fields

FieldExample
phone{{phone}}
messageIDBAE509D204172AC0

Example request

curl -X DELETE "https://letsbot.net/api/v1/message/delete?phone=9665xxxxxxxx&messageID=BAE509D204172AC0" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -F "phone=9665xxxxxxxx" \
  -F "messageID=BAE509D204172AC0"
const response = await fetch("https://letsbot.net/api/v1/message/delete?phone=%7B%7Bphone%7D%7D&messageID=BAE509D204172AC0", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
  },
  body: new URLSearchParams({
    "phone": "9665xxxxxxxx",
    "messageID": "BAE509D204172AC0",
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://letsbot.net/api/v1/message/delete?phone=%7B%7Bphone%7D%7D&messageID=BAE509D204172AC0');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => http_build_query([
        'phone' => '9665xxxxxxxx',
        'messageID' => 'BAE509D204172AC0',
    ]),
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "DELETE",
    "https://letsbot.net/api/v1/message/delete",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
    params={
        "phone": "9665xxxxxxxx",
        "messageID": "BAE509D204172AC0",
    },
    data={
        "phone": "9665xxxxxxxx",
        "messageID": "BAE509D204172AC0",
    },
)

print(response.json())

Responses

Delete Message by Id200
(empty body)

Ready when you are

Try this endpoint on your own number

The API works during the free trial. Create an account, connect your WhatsApp number and copy your key from API → Authentication Data.