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
}
}Deletes the 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
}
}API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
UID of the user on whose behalf the action is performed.
Id of the message whose details are to be deleted.
Deletes the message permanently.
Deleted Message
Was this page helpful?