Skip to content
Download Beeper

Delete a message

$client->messages->delete(string messageID, string chatID, ?bool forEveryone): void
DELETE/v1/chats/{chatID}/messages/{messageID}

Delete a message by final message ID. Pending message IDs are not accepted because messages cannot be deleted while sending.

ParametersExpand Collapse
chatID: string

Chat ID. Input routes also accept the local chat ID from this installation when available.

messageID: string

Message ID.

forEveryone?:optional bool

True to request deletion for everyone when the network supports it; false to delete only for the authenticated user when supported.

Delete a message

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(accessToken: 'My Access Token');

$result = $client->messages->delete(
  '1343993', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', forEveryone: true
);

var_dump($result);
Returns Examples