> ## Documentation Index
> Fetch the complete documentation index at: https://sitegpt.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Whitelabel User

> Update user of your whitelabel brand.

Pre-requisities: 
1. You have to be a whitelabel customer in SiteGPT.
2. You need to create and configure your own brand in SiteGPT dashboard.



## OpenAPI

````yaml patch /v0/w/brands/{brandId}/users/{userId}
openapi: 3.0.0
info:
  title: SiteGPT API Collection
  description: >-
    This collection contains the documentation of all the API endpoints.

    ## Getting started guide

    To start using the SiteGPT APIs, you need to 

    - You must use a valid API Key to send requests to the API endpoints. You
    can get your API key from SiteGPT's [billing
    dashboard](https://sitegpt.ai/billing). If you don't see it there, contact
    admin to generate one for you.

    - The API returns request responses in JSON format. When an API request
    returns an error, it is sent in the JSON response as an error key.
        
    ## Authentication

    SiteGPT uses API keys for authentication. You can generate a SiteGPT API key
    in the [billing dashboard](https://sitegpt.ai/billing).


    You must include an API key in each request to the Postman API with the
    Authorization request header.


    Header Name : Authorization


    Header Value : Bearer {{your-api-key}}


    ### Authentication error response

    If an API key is missing, malformed, or invalid, you will receive an HTTP
    401 Unauthorized response code.


    ## Need some help?

    In case you have any questions, feel free to contact us.
  license:
    name: SiteGPT Terms and Conditions
    url: https://sitegpt.ai/terms
  version: 1.0.0
  contact:
    name: Bhanu Teja P
    email: bhanu@sitegpt.ai
    url: mailto:bhanu@sitegpt.ai
servers:
  - url: https://sitegpt.ai/api
security:
  - bearerAuth: []
tags:
  - name: Chatbot
    x-displayName: Chatbots
    description: >-
      APIs to manage different chatbots. APIs include `Fetching All Chatbots`,
      `Creating New Chatbot`, Fetching One Chatbot`, `Updating Chatbot
      Appearance` and `Deleting Chatbot`.
    x-mint:
      icon: message-bot
  - name: Chatbot Appearance
    x-displayName: Appearance
    description: APIs to update appearance of the chatbot.
    x-mint:
      icon: palette
  - name: Chatbot Custom Content
    x-displayName: Custom Content
    description: APIs to modify custom content of the chatbot.
    x-mint:
      icon: file-pen
  - name: Chatbot Follow Up Prompts
    x-displayName: Follow-up Prompts
    description: >-
      APIs to manage `Follow up Prompts` of a particular chatbot. APIs include
      `Fetching All Follow up Prompts`, `Adding New Follow up Prompt`, `Fetching
      One Follow up Prompt`, `Updating Follow up Prompt` and `Deleting Follow up
      Prompt`.
    x-mint:
      icon: message-arrow-up
  - name: Chatbot Icons
    x-displayName: Icons
    description: APIs to manage (add/update/delete) icons related to a particular chatbot.
    x-mint:
      icon: icons
  - name: Chatbot Links
    x-displayName: Content & Training
    description: >-
      APIs to fetch internal links of any url and to add certain links to a
      particular chatbot.
    x-mint:
      icon: book-open
  - name: Chatbot Messages
    x-displayName: Messages
    description: >-
      APIs to send a message to a particular thread or start a new conversation
      with in a particular chatbot.
    x-mint:
      icon: messages
  - name: Chatbot Personas
    x-displayName: Personas
    description: APIs to manage personas of the chatbot.
    x-mint:
      icon: user-tie
  - name: Chatbot Prompts
    x-displayName: Instructions
    description: APIs to manage prompts of the chatbot.
    x-mint:
      icon: message-text
  - name: Chatbot Conversation Starters
    x-displayName: Conversation Starters
    description: >-
      APIs to manage `Conversation Starters` of a particular chatbot. APIs
      include `Fetching All Conversation Starters`, `Adding New Conversation
      Starter`, `Fetching One Conversation Starter`, `Updating Conversation
      Starter` and `Deleting Conversation Starter`.
    x-mint:
      icon: bolt
  - name: Chatbot Settings
    x-displayName: Settings
    description: >-
      APIs to update different settings of the chatbot. APIs include `General
      Settings`, `User Data Settings`, `Chat Mode Settings`, `Localization
      Settings` and `Advanced Settings`.
    x-mint:
      icon: gear
  - name: Chatbot Threads
    x-displayName: Threads
    description: >-
      APIs to manage threads related to a particular chatbot. APIs include
      `Fetching All Threads`, `Fetching One Thread` and `Update Thread`.
    x-mint:
      icon: message-lines
  - name: Whitelabel
    x-displayName: Whitelabel (Deprecated)
    description: >-
      APIs to manage whitelabel users. APIs include `Create Whitelabel User` and
      `Update Whitelabel User Quota`.
    x-mint:
      icon: tag
paths:
  /v0/w/brands/{brandId}/users/{userId}:
    parameters:
      - schema:
          type: string
        name: userId
        in: path
        required: true
        description: Id of the whitelabel user
      - schema:
          type: string
        name: brandId
        in: path
        required: true
        description: Id of the whitelabel brand
    patch:
      tags:
        - Whitelabel
      summary: Update Whitelabel User
      description: |-
        Update user of your whitelabel brand.

        Pre-requisities: 
        1. You have to be a whitelabel customer in SiteGPT.
        2. You need to create and configure your own brand in SiteGPT dashboard.
      operationId: update-whitelabel-user
      requestBody:
        description: Request body to update the whitelabel user of your brand.
        content:
          application/json:
            schema:
              type: object
              properties:
                chatbotsQuota:
                  type: integer
                  minimum: 0
                  description: Chatbots quota to be assigned to the user
                linksQuota:
                  type: integer
                  minimum: 0
                  description: Links quota to be assigned to the user
                filesQuota:
                  type: integer
                  minimum: 0
                  description: Files quota to be assigned to the user
                combinedMessagesQuota:
                  type: integer
                  minimum: 0
                  description: Combined messages quota to be assigned to the user
                membersQuota:
                  type: integer
                  minimum: 0
                  description: Members quota to be assigned to the user
                features:
                  type: object
                  description: >-
                    Features to be enabled/disabled for the user. You can
                    enable/disable only those features which are enabled for the
                    whitelabel brand owner.
                  properties:
                    watermark:
                      type: boolean
                      description: >-
                        Indicates whether the watermark feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.
                    api:
                      type: boolean
                      description: >-
                        Indicates whether the api feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.
                    webhooks:
                      type: boolean
                      description: >-
                        Indicates whether the webhooks feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.
                    functions:
                      type: boolean
                      description: >-
                        Indicates whether the functions feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.
                    integrations:
                      type: boolean
                      description: >-
                        Indicates whether the integrations feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. API key needs to be generated.

                        3. API feature flag should be enabled.
                    googleChatIntegration:
                      type: boolean
                      description: >-
                        Indicates whether the google chat feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. Integrations feature should be enabled.
                    messengerChatIntegration:
                      type: boolean
                      description: >-
                        Indicates whether the messenger chat feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. Integrations feature should be enabled.
                    crispChatIntegration:
                      type: boolean
                      description: >-
                        Indicates whether the crisp chat feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. Integrations feature should be enabled.
                    slackChatIntegration:
                      type: boolean
                      description: >-
                        Indicates whether the slack chat feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. Integrations feature should be enabled.
                    zendeskChatIntegration:
                      type: boolean
                      description: >-
                        Indicates whether the zendesk chat feature to be
                        enabled/disabled.


                        Pre Requisities:

                        1. Brand owner needs to have access to this feature.

                        2. Integrations feature should be enabled.
            examples:
              Request Body:
                value:
                  chatbotsQuota: 1
                  linksQuota: 100
                  filesQuota: 25
                  combinedMessagesQuota: 250
                  membersQuota: 2
                  features:
                    api: true
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      Indicates whether this is success response or error
                      response
                  message:
                    type: string
                    description: Overall message regarding the operation performed
                  data:
                    description: Data returned from the server
                    type: object
                    properties:
                      whitelabelUser:
                        $ref: '#/components/schemas/WhitelabelUser'
              examples:
                Success Response:
                  value:
                    success: true
                    message: Updated the whitelabel user of the brand successfully
                    data:
                      whitelabelUser:
                        id: '332153612345906321'
                        brandId: '332110515123458123'
                        email: user@example.com
                        name: ''
                        profilePic: ''
                        chatbotsQuota: 2
                        linksQuota: 20
                        filesQuota: 5
                        combinedMessagesQuota: 25
                        membersQuota: 2
                        features:
                          watermark: false
                          api: true
                          webhooks: false
                          functions: false
                          integrations: false
                          googleChatIntegration: false
                          messengerChatIntegration: false
                          crispChatIntegration: false
                          slackChatIntegration: false
                          zendeskChatIntegration: false
                        createdAt: '2024-02-05T13:35:44.155845Z'
                        updatedAt: '2024-02-05T13:35:44.155845Z'
        '400':
          description: Bad Request
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Validation Error:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: REQUEST_VALIDATION_FAILED
                      message: Request body is not valid
                      details:
                        - path:
                            - brandId
                          message: Required
        '401':
          description: Unauthorized
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Authentication Error:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: API_KEY_NOT_VALID
                      message: Authorization header does not contain valid API key
                      details: null
        '403':
          description: Forbidden
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Forbidden Error 1:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: UPDATE_WHITELABEL_USER_FORBIDDEN
                      message: >-
                        You are not authorized to update the whitelabel user of
                        the brand
                Forbidden Error 2:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: UPDATE_WHITELABEL_USER_FEATURE_ACCESS_FORBIDDEN
                      message: >-
                        You are not authorized to update api feature for the
                        whitelabel user
        '404':
          description: Not Found
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Not Found Error:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: UPDATE_WHITELABEL_USER_BRAND_NOT_FOUND
                      message: Whitelabel brand not found
        '405':
          description: Method Not Allowed
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Method Not Allowed Error:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: REQUEST_METHOD_NOT_ALLOWED
                      message: POST request method is not allowed
        '500':
          description: Internal Server Error
          headers:
            Content-Type:
              schema:
                type: string
              description: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Server Error:
                  value:
                    success: false
                    message: Failed to update the whitelabel user of the brand
                    data: null
                    error:
                      code: UPDATE_WHITELABEL_USER_FAILED
                      message: Some technical error has occurred !!
      deprecated: true
components:
  schemas:
    WhitelabelUser:
      title: Whitelabel-User
      type: object
      description: Whitelabel User
      properties:
        id:
          type: string
          description: Id of the whitelabel user
        brandId:
          type: string
          description: Id of the brand which whitelabel user belongs to
        email:
          type: string
          description: Email of the whitelabel user
        name:
          type: string
          description: Name of the whitelabel user
        profilePic:
          type: string
          description: Profile picture url of the whitelabel user
        chatbotsQuota:
          type: integer
          description: Chatbots quota of the whitelabel user
        linksQuota:
          type: integer
          description: Links quota of the whitelabel user
        filesQuota:
          type: integer
          description: Files quota of the whitelabel user
        combinedMessagesQuota:
          type: integer
          description: Messages quota of the whitelabel user
        membersQuota:
          type: integer
          description: Members quota of the whitelabel user
        apiKey:
          type: string
          description: API key of the whitelabel user
        features:
          $ref: '#/components/schemas/WhitelabelUserFeatures'
        createdAt:
          type: string
          format: date-time
          description: Timestamp at which the whitelabel user has been created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp at which the whitelabel user has been recently updated
    ErrorResponse:
      type: object
      description: Error Response
      properties:
        success:
          type: boolean
          description: Indicates that this is error response
        message:
          type: string
          description: Overall error message regarding the operation performed
        data:
          type: object
          description: Data returned from the API. This will be `null` for errors
          nullable: true
        error:
          type: object
          description: Object with the error details
          properties:
            code:
              type: string
              description: Based on this error code, you can identify what is the error
            message:
              type: string
              description: The message indicating the reason for the error
            details:
              type: array
              description: More details on the error. Applicable only for Validation errors
              nullable: true
              items:
                type: object
                properties:
                  path:
                    type: array
                    description: >-
                      Specifies the path in request body where error occurred.
                      If the error field is nexted, then this array length will
                      be more than 1.
                    items:
                      oneOf:
                        - type: string
                          description: Specifies the name of the field
                        - type: integer
                          description: Specifies the position in an array
                  message:
                    type: string
                    description: Reason for the error of the path mentioned before
    WhitelabelUserFeatures:
      title: WhitelabelUserFeatures
      type: object
      description: Features of Whitelabel User
      properties:
        watermark:
          type: boolean
          description: Indicates whether the watermark feature is enabled or not
        api:
          type: boolean
          description: Indicates whether the api feature is enabled or not
        webhooks:
          type: boolean
          description: Indicates whether the webhooks feature is enabled or not
        functions:
          type: boolean
          description: Indicates whether the functions feature is enabled or not
        integrations:
          type: boolean
          description: Indicates whether the integrations feature is enabled or not
        googleChatIntegration:
          type: boolean
          description: Indicates whether the google chat feature is enabled or not
        messengerChatIntegration:
          type: boolean
          description: Indicates whether the messenger chat feature is enabled or not
        crispChatIntegration:
          type: boolean
          description: Indicates whether the crisp chat feature is enabled or not
        slackChatIntegration:
          type: boolean
          description: Indicates whether the slack chat feature is enabled or not
        zendeskChatIntegration:
          type: boolean
          description: Indicates whether the zendesk chat feature is enabled or not
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````