Skip to main content
POST
/
users
Create
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/users \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "uid": "<string>",
  "name": "<string>",
  "avatar": "<string>",
  "link": "<string>",
  "role": "<string>",
  "statusMessage": "<string>",
  "metadata": {
    "@private": {
      "email": "user@email.com",
      "contactNumber": "0123456789"
    }
  },
  "tags": [],
  "withAuthToken": true
}'
{
  "data": {
    "uid": "superhero6",
    "name": "Barry Allen",
    "link": "http://placehold.it",
    "avatar": "http://placehold.it/120x120&text=image1",
    "metadata": {
      "rawMetadata": "{'gender':'Male'}"
    },
    "status": "offline",
    "role": "manager",
    "createdAt": 1638354015,
    "tags": [
      "Engineer",
      "manager"
    ],
    "authToken": "superhero6_16383540156641d37a023c75d26f4c22a21ff126"
  }
}

Authorizations

apikey
string
header
required

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

Body

application/json
uid
string
required

Unique identifier of the user. Please refer to https://prodocs.cometchat.com/docs/concepts#uid

name
string
required

Display name of the user.

avatar
string

URL to profile picture of the user.

URL to profile page.

role
string

User role of the user for role based access control.

statusMessage
string

A message providing context related to the user's current status or mood.

metadata
object

Additional information about the user as JSON. If you plan to use Email Notification or SMS Notification extensions, Please add the private metadata here.

tags
string[]

A list of tags to identify specific users.

withAuthToken
boolean

Includes authToken of created user in response.

Response

200 - application/json

Create User

data
object
I