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

# Update

> Update a CometChat bot's webhook, group chat setting, basic auth credentials or enabled state with the REST API.

Every field is optional — send only the ones you want to change. The bot's `uid` cannot be changed; delete the bot and create a new one instead.

`groupChatSetting` accepts the same four values as the [Create Bot API](https://www.cometchat.com/docs/rest-api/bots/create.md): `allMessages`, `slashedMessages`, `mentionedMessages` and `none`.

Unlike the Create Bot API, Update stores `username` and `password` as sent, whatever `useBasicAuth` is set to. Setting `useBasicAuth` to `false` stops credentials being sent with webhook calls, but does not clear the stored `username` and `password`. They stay in responses.

Setting `enabled` to `false` stops the bot relaying messages without deleting it.

A bot's name and avatar belong to its user — change them with the [Update User API](https://www.cometchat.com/docs/rest-api/users/update.md).

`updatedAt` appears in the response once a bot has been updated.

> [!WARNING]
>
> The API returns the stored `password` value as it was saved, including after `useBasicAuth` is set to `false`. The example masks it as `********`.

For the complete error reference, see [Error Guide](https://www.cometchat.com/docs/articles/error-guide.md).


## OpenAPI

````yaml put /bots/{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: Bots
    description: The bots relay messages from your app to a webhook.
  - 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.
  - name: Moderation
    description: The REST collections for Moderations.
paths:
  /bots/{uid}:
    put:
      tags:
        - Bots
      summary: Update
      description: Updates a bot with the provided UID
      operationId: update-bot
      parameters:
        - name: uid
          in: path
          description: An UID of a bot.
          required: true
          schema:
            type: string
          examples:
            string:
              summary: UID
              value: ''
      requestBody:
        content:
          application/json:
            schema:
              properties:
                webhookURL:
                  description: >-
                    URL that receives the messages relayed to the bot. Maximum
                    255 characters.
                  type: string
                groupChatSetting:
                  description: >-
                    Which group messages are relayed to the webhook. Possible
                    values: allMessages, slashedMessages, mentionedMessages,
                    none.
                  type: string
                  enum:
                    - allMessages
                    - slashedMessages
                    - mentionedMessages
                    - none
                useBasicAuth:
                  description: >-
                    Sends HTTP basic auth credentials with every webhook call.
                    Setting this to false does not clear a stored username or
                    password.
                  type: boolean
                username:
                  description: >-
                    Basic auth username. Maximum 50 characters. Stored as sent,
                    whatever useBasicAuth is set to.
                  type: string
                password:
                  description: >-
                    Basic auth password. Maximum 50 characters. Stored as sent,
                    whatever useBasicAuth is set to, and returned in responses.
                  type: string
                enabled:
                  description: Whether the bot relays messages to its webhook.
                  type: boolean
              type: object
      responses:
        '200':
          description: Updated Bot
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object
                type: object
              example:
                data:
                  uid: support-bot
                  webhookURL: https://example.com/webhooks/support-bot-v2
                  groupChatSetting: allMessages
                  useBasicAuth: true
                  username: support-bot
                  password: '********'
                  enabled: true
                  createdAt: 1763558400
                  updatedAt: 1763561000
      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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.