Delete Message
curl --request DELETE \
--url https://{appId}.api-{region}.cometchat.io/v3/messages/{id} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"permanent": true
}
'{
"data": {
"id": "402",
"conversationId": "cometchat-uid-1_user_cometchat-uid-2",
"sender": "cometchat-uid-1",
"receiverType": "user",
"receiver": "cometchat-uid-2",
"category": "action",
"type": "message",
"data": {
"action": "edited",
"entities": {
"by": {
"entity": {
"uid": "cometchat-uid-1",
"name": "Updated Name",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"for": {
"entity": {
"uid": "cometchat-uid-2",
"name": "George Alan",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"on": {
"entity": {
"id": "69",
"conversationId": "cometchat-uid-1_user_cometchat-uid-2",
"sender": "cometchat-uid-1",
"receiverType": "user",
"receiver": "cometchat-uid-2",
"category": "message",
"type": "text",
"data": {
"text": "hello spider",
"entities": {
"sender": {
"entity": {
"uid": "cometchat-uid-1",
"name": "Andrew Joseph",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp",
"status": "offline",
"createdAt": 1639448370
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "cometchat-uid-2",
"name": "George Alan",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp",
"status": "offline",
"createdAt": 1639448370,
"conversationId": "cometchat-uid-1_user_cometchat-uid-2"
},
"entityType": "user"
}
}
},
"sentAt": 1640171302,
"editedAt": 1641477338,
"editedBy": "app_system",
"updatedAt": 1641477338,
"tags": [
"t6"
]
},
"entityType": "message"
}
}
},
"sentAt": 1641477338,
"updatedAt": 1641477338
}
}Messages
Delete Message
Delete a CometChat message by message ID with REST API to remove it from a user or group conversation.
DELETE
/
messages
/
{id}
Delete Message
curl --request DELETE \
--url https://{appId}.api-{region}.cometchat.io/v3/messages/{id} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"permanent": true
}
'{
"data": {
"id": "402",
"conversationId": "cometchat-uid-1_user_cometchat-uid-2",
"sender": "cometchat-uid-1",
"receiverType": "user",
"receiver": "cometchat-uid-2",
"category": "action",
"type": "message",
"data": {
"action": "edited",
"entities": {
"by": {
"entity": {
"uid": "cometchat-uid-1",
"name": "Updated Name",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"for": {
"entity": {
"uid": "cometchat-uid-2",
"name": "George Alan",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"on": {
"entity": {
"id": "69",
"conversationId": "cometchat-uid-1_user_cometchat-uid-2",
"sender": "cometchat-uid-1",
"receiverType": "user",
"receiver": "cometchat-uid-2",
"category": "message",
"type": "text",
"data": {
"text": "hello spider",
"entities": {
"sender": {
"entity": {
"uid": "cometchat-uid-1",
"name": "Andrew Joseph",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp",
"status": "offline",
"createdAt": 1639448370
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "cometchat-uid-2",
"name": "George Alan",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp",
"status": "offline",
"createdAt": 1639448370,
"conversationId": "cometchat-uid-1_user_cometchat-uid-2"
},
"entityType": "user"
}
}
},
"sentAt": 1640171302,
"editedAt": 1641477338,
"editedBy": "app_system",
"updatedAt": 1641477338,
"tags": [
"t6"
]
},
"entityType": "message"
}
}
},
"sentAt": 1641477338,
"updatedAt": 1641477338
}
}For the complete error reference, see Error Guide.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-add-campaigns-webhooks.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
Headers
UID of the user on whose behalf the action is performed.
Path Parameters
Id of the message whose details are to be deleted.
Body
application/json
Deletes the message permanently.
Response
200 - application/json
Deleted Message
Was this page helpful?
⌘I