POST
/
moderation
/
messages
Send message
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/moderation/messages \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "category": "message",
  "type": "text",
  "data": {
    "text": "Hey there! Welcome aboard."
  },
  "sender": "cometchat-test-user-1",
  "receiver": "cometchat-test-user-2",
  "senderUserDetails": {
    "uid": "cometchat-test-user-1",
    "name": "Test User 1"
  },
  "receiverUserDetails": {
    "uid": "cometchat-test-user-2",
    "name": "Test User 2"
  },
  "receiverType": "user"
}'
{
  "data": {
    "id": "1",
    "conversationId": "cometchat-uid-1_user_cometchat-uid-2",
    "sender": "cometchat-uid-2",
    "receiverType": "user",
    "receiver": "cometchat-uid-1",
    "category": "message",
    "type": "text",
    "data": {
      "text": "Hi new user",
      "entities": {
        "sender": {
          "entity": {
            "uid": "cometchat-uid-2",
            "name": "George Alan",
            "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp",
            "status": "offline",
            "role": "default",
            "lastActiveAt": 1751644824,
            "createdAt": 1751644824,
            "conversationId": "cometchat-uid-1_user_cometchat-uid-2"
          },
          "entityType": "user"
        },
        "receiver": {
          "entity": {
            "uid": "cometchat-uid-1",
            "name": "Andrew Joseph",
            "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp",
            "status": "offline",
            "role": "default",
            "lastActiveAt": 1751644824,
            "createdAt": 1751644824
          },
          "entityType": "user"
        }
      },
      "moderation": {
        "status": "pending"
      }
    },
    "sentAt": 1750335220,
    "updatedAt": 1751644906
  }
}

Authorizations

apikey
string
header
required

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

Body

application/json

Response

200 - application/json

Import Message(s)

The response is of type object.