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

# Team capacity insights

> Returns workload, performance, and burnout-risk analytics for team members.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /insights/_capacity
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:
  /insights/_capacity:
    post:
      tags:
        - todo
      summary: Team capacity insights
      description: >-
        Returns workload, performance, and burnout-risk analytics for team
        members.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_todo_insights.CapacityRequest'
        description: Capacity analytics request
        required: true
      responses:
        '200':
          description: Capacity analytics response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_todo_insights.capacityResponse'
        '400':
          description: Bad request - invalid request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - admin scope and workflow insights feature flag required
          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_todo_insights.CapacityRequest:
      type: object
      properties:
        assignee:
          type: string
        assignee_type:
          type: string
        end_date:
          type: string
        include_unassigned:
          type: boolean
        start_date:
          type: string
        timezone:
          type: string
    pkg_routes_todo_insights.capacityResponse:
      type: object
      properties:
        recommendations:
          type: array
          items:
            $ref: >-
              #/components/schemas/pkg_routes_todo_insights.capacityRecommendation
        references:
          type: object
          properties:
            users:
              type: array
              items:
                $ref: >-
                  #/components/schemas/pkg_routes_todo_insights.insightUserReference
        summary:
          $ref: '#/components/schemas/pkg_routes_todo_insights.capacitySummary'
        team_summary:
          $ref: '#/components/schemas/pkg_routes_todo_insights.capacityTeamSummary'
        users:
          type: array
          items:
            $ref: '#/components/schemas/pkg_routes_todo_insights.capacityUserSummary'
    pkg_routes_todo_insights.capacityRecommendation:
      type: object
      properties:
        priority:
          type: string
        reasons:
          type: array
          items:
            type: string
        source_user_id:
          type: string
        summary:
          type: string
        target_user_id:
          type: string
        type:
          type: string
    pkg_routes_todo_insights.insightUserReference:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        user_id:
          type: string
    pkg_routes_todo_insights.capacitySummary:
      type: object
      properties:
        active_task_count:
          type: integer
        avg_completed_task_count_per_user:
          type: number
        completed_task_count:
          type: integer
        overdue_task_count:
          type: integer
        users_included:
          type: integer
    pkg_routes_todo_insights.capacityTeamSummary:
      type: object
      properties:
        median_active_assigned_task_count:
          type: number
        median_avg_open_task_age_hours:
          type: number
        median_completed_task_count:
          type: number
        median_overdue_task_count:
          type: number
    pkg_routes_todo_insights.capacityUserSummary:
      type: object
      properties:
        email:
          type: string
        labels:
          type: array
          items:
            type: string
        metrics:
          $ref: '#/components/schemas/pkg_routes_todo_insights.capacityMetrics'
        name:
          type: string
        reasons:
          type: array
          items:
            type: string
        scores:
          $ref: '#/components/schemas/pkg_routes_todo_insights.capacityScores'
        user_id:
          type: string
    pkg_routes_todo_insights.capacityMetrics:
      type: object
      properties:
        active_assigned_task_count:
          type: integer
        active_client_count:
          type: integer
        active_workload_hours:
          type: number
        available_not_started_task_count:
          type: integer
        avg_open_task_age_hours:
          type: number
        avg_time_to_complete_hours:
          type: number
        completed_task_count:
          type: integer
        completed_task_pct_of_team:
          type: number
        completion_rank:
          type: integer
        flagged_task_count:
          type: integer
        load_days:
          type: number
        max_open_task_age_hours:
          type: number
        max_time_to_complete_hours:
          type: number
        median_time_to_complete_hours:
          type: number
        onboarding_client_count:
          type: integer
        overdue_task_count:
          type: integer
        raw_routing_utilization:
          type: number
        routing_utilization:
          type: number
        terminating_client_count:
          type: integer
        total_client_count:
          type: integer
    pkg_routes_todo_insights.capacityScores:
      type: object
      properties:
        burnout_risk_score:
          type: number
        performance_score:
          type: number
        workload_score:
          type: number
  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.