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"
}
}
Creates a new user
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"
}
}
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
Create User
The response is of type object
.
Was this page helpful?