Skip to main content
POST
/
bots
/
{uid}
/
messages
Send Bot Message
curl --request POST \
  --url https://{appId}.api-{region}.cometchat.io/v3/bots/{uid}/messages \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "receiver": "<string>",
  "muid": "<string>",
  "receiverType": "user",
  "category": "message",
  "type": "text",
  "data": {
    "text": "<string>",
    "metadata": {},
    "attachments": [
      {
        "url": "<string>",
        "name": "<string>",
        "mimeType": "<string>",
        "extension": "<string>",
        "size": "<string>"
      }
    ]
  },
  "multipleReceivers": {
    "uids": [
      "<string>"
    ],
    "guids": [
      "<string>"
    ]
  },
  "tags": [
    "<string>"
  ]
}
'
{
  "data": {
    "id": "1",
    "conversationId": "cometchat-uid-3_user_cometchat-uid-5",
    "sender": "cometchat-uid-3",
    "receiverType": "user",
    "receiver": "cometchat-uid-5",
    "category": "message",
    "type": "text",
    "data": {
      "text": "test     hello",
      "metadata": {
        "key1": "val1"
      },
      "entities": {
        "sender": {
          "entity": {
            "uid": "cometchat-uid-3",
            "name": "Nancy Grace",
            "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp",
            "status": "offline",
            "role": "default",
            "createdAt": 1638361550
          },
          "entityType": "user"
        },
        "receiver": {
          "entity": {
            "uid": "cometchat-uid-5",
            "name": "John Paul",
            "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp",
            "status": "offline",
            "role": "default",
            "createdAt": 1638361550,
            "conversationId": "cometchat-uid-3_user_cometchat-uid-5"
          },
          "entityType": "user"
        }
      }
    },
    "sentAt": 1638423490,
    "updatedAt": 1638423490
  }
}

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).

Path Parameters

uid
string
required

An UID of the Bot.

Body

application/json
receiver
string

The receiver of the message.

muid
string

The muid will be a unique Identifier of the message.

receiverType
enum<string>

The receiverType of the message. either user or group

Available options:
user,
group
category
enum<string>
default:message

Category of the message. The available categories are message and custom.

Available options:
message
type
enum<string>
default:text

Type of the message. The available values are text, image, file, audio, video.

Available options:
text,
image,
file,
audio,
video
data
object

JSON containing message attributes.

multipleReceivers
object

JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {"uids": ["uid1","uid2"], "guids":["guid1"]}

tags
string[]

A list of tags to identify specific messages.

Response

200 - application/json

Send Bot Message

data
object