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

# Update agent availability

> Update an agent''s availability status and per-agent chat capacity. Use when reading or setting agent availability from a workforce management tool.



## OpenAPI

````yaml put /agent-availability/{userId}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /agent-availability/{userId}:
    put:
      summary: Update agent availability
      description: >-
        Update an agent's availability status and per-agent chat capacity. The
        agent must belong to the API key's organization.
      operationId: updateAgentAvailability
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
          in: path
          name: userId
          required: true
          description: Organization user ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentAvailabilityPublicDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAvailability'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    UpdateAgentAvailabilityPublicDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/UpdateAgentAvailabilityPublicDtoInput'
      type: object
      properties:
        is_available:
          description: Whether the agent is available to take chats
          type: boolean
        custom_status:
          description: Free-form status label
          type:
            - string
            - 'null'
        max_concurrent_chats:
          description: Per-agent chat capacity
          type: integer
          minimum: 0
          maximum: 9007199254740991
        call_available:
          description: Whether the agent is available for inbound phone calls
          type: boolean
    AgentAvailability:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/AgentAvailability'
      type: object
      properties:
        id:
          type: string
        user_id:
          type: number
        organization_id:
          type: string
        is_available:
          type: boolean
        custom_status:
          type:
            - string
            - 'null'
        last_status_change:
          type: string
          format: date-time
        current_chat_count:
          type: number
        max_concurrent_chats:
          type: number
        notes:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        call_available:
          type: boolean
        call_locked:
          type: boolean
        call_wrap_up_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        call_wrap_up_started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        call_wrap_up_phone_call_id:
          type:
            - string
            - 'null'
        availability_status_id:
          type:
            - string
            - 'null'
      required:
        - id
        - user_id
        - organization_id
        - is_available
        - custom_status
        - last_status_change
        - current_chat_count
        - max_concurrent_chats
        - notes
        - created_at
        - updated_at
        - call_available
        - call_locked
        - call_wrap_up_until
        - call_wrap_up_phone_call_id
        - availability_status_id
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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