Deletes the specified Message.


Deletes the specified Message.

Top ↑


bool deleteMessage( string api_key, int message_id );


api_key (string)

The key required to access the API. See Getting Started for more information.

message_id (int)

The ID of the Message.

Return Value

Returns true on success or false on failure.


In the following code, Message 1111222 is deleted.

$message_id = 1111222;     // see searchMessages()

$api = new Api($url, 'YOURAPIKEY');
$deleted = $api->invokeMethod('deleteMessage', $message_id);
    "id": 6,
    "method": "deleteMessage",
    "params": [
    "id": 6,
    "result": true,
    "error": null

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
310 Invalid Method Parameters message_id is not valid.
307 Unable to Load Message message_id is not a valid Message.

See Also