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

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 a user.

Body

application/json
name
string

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.

unset
enum<string>[]

The unsettable user attributes are avatar, link and metadata.

Response

200 - application/json

Updated user

data
object
I