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

# Remove user (client portal)

> Revoke a user's access to the caller's client: pulls that client's entry from the user's clients, soft-deletes their open invitations to the client and ends their sessions on it (ENG-9407). The account and its access to other clients or teams are kept; an account left with no client and no team is soft-deleted, as clients/_suspend does. The target must have access to the caller's client and team: anyone else is a 404. Cannot remove yourself. Requires a client portal session with client::iam.



## OpenAPI

````yaml /api-reference/cx/swagger.json delete /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}:
    delete:
      tags:
        - client-portal
      summary: Remove user (client portal)
      description: >-
        Revoke a user's access to the caller's client: pulls that client's entry
        from the user's clients, soft-deletes their open invitations to the
        client and ends their sessions on it (ENG-9407). The account and its
        access to other clients or teams are kept; an account left with no
        client and no team is soft-deleted, as clients/_suspend does. The target
        must have access to the caller's client and team: anyone else is a 404.
        Cannot remove yourself. Requires a client portal session with
        client::iam.
      parameters:
        - description: User ID
          name: user
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Removal result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_cp_user.RemoveUserResponse'
        '400':
          description: Bad request - invalid user ID or attempting to remove yourself
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - no client context or missing client::iam on this client
          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.RemoveUserResponse:
      type: object
      properties:
        ok:
          type: boolean
  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.