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": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "action",
"type": "message",
"data": {
"action": "edited",
"entities": {
"by": {
"entity": {
"uid": "superhero1",
"name": "Updated Name",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"for": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"on": {
"entity": {
"id": "69",
"conversationId": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "message",
"type": "text",
"data": {
"text": "hello spider",
"entities": {
"sender": {
"entity": {
"uid": "superhero1",
"name": "Iron Man",
"role": "default",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png",
"status": "offline",
"createdAt": 1639448370
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"role": "default",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png",
"status": "offline",
"createdAt": 1639448370,
"conversationId": "superhero1_user_superhero2"
},
"entityType": "user"
}
}
},
"sentAt": 1640171302,
"editedAt": 1641477338,
"editedBy": "app_system",
"updatedAt": 1641477338,
"tags": [
"t6"
]
},
"entityType": "message"
}
}
},
"sentAt": 1641477338,
"updatedAt": 1641477338
}
}Messages
Delete Message
Deletes the message.
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": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "action",
"type": "message",
"data": {
"action": "edited",
"entities": {
"by": {
"entity": {
"uid": "superhero1",
"name": "Updated Name",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"for": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png",
"status": "offline",
"role": "default",
"createdAt": 1639448370
},
"entityType": "user"
},
"on": {
"entity": {
"id": "69",
"conversationId": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "message",
"type": "text",
"data": {
"text": "hello spider",
"entities": {
"sender": {
"entity": {
"uid": "superhero1",
"name": "Iron Man",
"role": "default",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png",
"status": "offline",
"createdAt": 1639448370
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"role": "default",
"avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png",
"status": "offline",
"createdAt": 1639448370,
"conversationId": "superhero1_user_superhero2"
},
"entityType": "user"
}
}
},
"sentAt": 1640171302,
"editedAt": 1641477338,
"editedBy": "app_system",
"updatedAt": 1641477338,
"tags": [
"t6"
]
},
"entityType": "message"
}
}
},
"sentAt": 1641477338,
"updatedAt": 1641477338
}
}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