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

> Updates a user with the provided UID

# Update

For the complete error reference, see [Error Guide](/articles/error-guide).


## OpenAPI

````yaml put /users/{uid}
openapi: 3.0.0
info:
  title: Chat APIs
  description: Manage messages, users, groups for a particular app using our Chat API.
  version: '3.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: API Keys
    description: The API keys are used to authorise the APIs
  - name: Roles
    description: The roles are used to give user access rights
  - name: Users
    description: The REST collection for users.
  - name: Auth Tokens
    description: The auth tokens are used to login end users using client SDKs.
  - name: Blocked Users
    description: The REST collections for blocked users.
  - name: Friends
    description: List,add and remove friends by passing UID in path variables
  - name: Groups
    description: The REST collections for groups.
  - name: Banned Users
    description: Ban and Unban user by passing other UID in path variables.
  - name: Group Members
    description: The REST collections for group members.
  - name: Messages
    description: The REST collections for messages.
  - name: Conversations
    description: The REST collections for conversations.
  - name: Restrict Features
    description: Allows Restricting Features
  - name: Metrics
    description: Allows accessing Data Metrics
  - name: Triggers
    description: Allows adding triggers to a webhook.
  - name: Webhooks
    description: Allows accessing Webhooks.
  - name: Notifications
    description: Allows configuring Notifications core.
paths:
  /users/{uid}:
    put:
      tags:
        - Users
      summary: Update
      description: Updates a user with the provided UID
      operationId: update-user
      parameters:
        - name: uid
          in: path
          description: An UID of a user.
          required: true
          schema:
            type: string
          examples:
            string:
              summary: UID
              value: cometchat-uid-1
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  description: Display name of the user.
                  type: string
                avatar:
                  description: URL to profile picture of the user.
                  type: string
                link:
                  description: URL to profile page.
                  type: string
                role:
                  description: User role of the user for role based access control.
                  type: string
                statusMessage:
                  description: >-
                    A message providing context related to the user's current
                    status or mood.
                  type: string
                metadata:
                  description: >-
                    Additional information about the user as JSON. If you plan
                    to use [Email
                    Notification](doc:android-extensions-email-notification#section-configure-your-backend-to-store-emails)
                    or [SMS
                    Notification](doc:android-extensions-sms-notification#section-configure-your-backend-to-store-phone-number)
                    extensions, Please add the private metadata here.
                  properties:
                    '@private':
                      properties:
                        email:
                          type: string
                        contactNumber:
                          type: string
                      type: object
                  type: object
                  default:
                    '@private':
                      email: user@email.com
                      contactNumber: '0123456789'
                tags:
                  description: A list of tags to identify specific users.
                  type: array
                  items:
                    type: string
                  default:
                    - tag1
                unset:
                  description: >-
                    The unsettable user attributes are avatar, link and
                    metadata.
                  type: array
                  items:
                    type: string
                    enum:
                      - avatar
                      - link
                      - metadata
                    description: User attributes that can be unset.
                  default:
                    - avatar
              type: object
      responses:
        '200':
          description: Updated user
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object
                type: object
              example:
                data:
                  uid: cometchat-uid-6
                  name: Barry Allen
                  link: https://cometchat.com
                  avatar: >-
                    https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp
                  metadata:
                    email: user@email.com
                    contactNumber: '0123456789'
                  status: offline
                  role: manager
                  createdAt: 1638354015
                  updatedAt: 1638354799
                  tags:
                    - cometchat-guid-1
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````