Skip to main content
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
  }
}

Documentation Index

Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

For the complete error reference, see Error Guide.

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Headers

onBehalfOf
string

UID of the user on whose behalf the action is performed.

Path Parameters

id
string
required

Id of the message whose details are to be deleted.

Body

application/json
permanent
boolean

Deletes the message permanently.

Response

200 - application/json

Deleted Message

data
object