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

# Invite user to client portal (client portal)

> Invite a user to the caller's client in the client portal. Creates an invitation, associates the contact with the client, and sends the invitation email. Requires a client portal session with client::iam on its client (ENG-9400). Scopes must be client portal scopes the caller holds; client and user are always added.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /cp/user/_invite
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/_invite:
    post:
      tags:
        - client-portal
      summary: Invite user to client portal (client portal)
      description: >-
        Invite a user to the caller's client in the client portal. Creates an
        invitation, associates the contact with the client, and sends the
        invitation email. Requires a client portal session with client::iam on
        its client (ENG-9400). Scopes must be client portal scopes the caller
        holds; client and user are always added.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
        description: Invitation data (name, email, scopes required; role optional)
        required: true
      responses:
        '200':
          description: Invitation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_cp_user.InviteUserResponse'
        '400':
          description: >-
            Bad request - invalid request body, missing team branding, or
            invalid scopes
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: >-
            Forbidden - no client context, missing client::iam on this client,
            or a scope the caller doesn't hold
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Client not found or no access
          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.InviteUserResponse:
      type: object
      properties:
        invite_url:
          type: string
        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.