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

# Update user (client portal)

> Update a user of the caller's client: name, role on the client, and scopes on the client. Requires client::iam on the caller's client, and the target must have access to that client (ENG-9400). Email addresses can't be changed from the portal: an email equal to the current one is ignored, any other is refused. New scopes must be client portal scopes the caller holds.



## OpenAPI

````yaml /api-reference/cx/swagger.json patch /cp/user/{user}
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /cp/user/{user}:
    patch:
      tags:
        - client-portal
      summary: Update user (client portal)
      description: >-
        Update a user of the caller's client: name, role on the client, and
        scopes on the client. Requires client::iam on the caller's client, and
        the target must have access to that client (ENG-9400). Email addresses
        can't be changed from the portal: an email equal to the current one is
        ignored, any other is refused. New scopes must be client portal scopes
        the caller holds.
      parameters:
        - description: User ID
          name: user
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_cp_user.UpdateUserRequest'
        description: User update data
        required: true
      responses:
        '200':
          description: Update result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_cp_user.UpdateUserResponse'
        '400':
          description: Bad request - invalid user ID, request body or scopes
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: >-
            Forbidden - no client context, missing client::iam on this client,
            an email change, or a scope above the caller's own
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: User not found or has no access to the caller's client
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_cp_user.UpdateUserRequest:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        role:
          type: string
        scopes:
          type: array
          items:
            type: string
    pkg_routes_cp_user.UpdateUserResponse:
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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