Delete Message
Remove a message for a current user.
Recipes
Delete messages from all chat histories
Delete messages from all chat histories
1. Specify if you want to delete messages from all chat histories
force parameter to 1 to delete messages from all chat histories.2. Set the IDs of the messages
3. As a result, the messages will be deleted from all chat histories.
Delete messages from your own chat history
Delete messages from your own chat history
1. Set the IDs of the messages
2. As a result, the messages are removed for a user who has sent the request without affecting chat histories of other users.
Delete messages from specific user chat history with API key
Delete messages from specific user chat history with API key
1. Use 'Authorization' header to pass API key
2. Use 'On-Behalf-Of' header to pass user id
3. Set the IDs of the messages
4. As a result, the messages are removed for a user who has sent the request without affecting chat histories of other users.
Delete messages from all chat histories
Delete messages from all chat histories
1. Use 'Authorization' header to pass API key
2. Set the IDs of the messages
3. As a result, the messages will be deleted from all chat histories.
Hard delete messages from chat history with API key
Hard delete messages from chat history with API key
1. Specify if you want to delete messages from all chat histories
force parameter to 1 to delete messages from all chat histories.2. Use 'Authorization' header to pass API key
3. Set the IDs of the messages
4. As a result, the messages will be deleted from all chat histories.
occupants_ids is able to remove a message from the dialog. The message will only be removed for the current user. The message will still be viewable in the chat history for all other users in the dialog.
You may be wondering why this request only deletes the message for the current user. It is to allow deletion functionality within your app and ensure the message does not reappear in the user chat history, but without affecting the history of other users.
It is possible to completely remove a message by the owner - pass force=1.
Starting from version 2.52.0, admins can also completely remove messages of other users using force=1.
Path Parameters
Body Parameters
force=1 to perform. Only the owner can do it. Starting from v2.52.0, for dialog type=1 (PUBLIC_GROUP) and type=2 (GROUP), admins can also delete messages of other occupants.Headers
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
404
404