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

# Task Count by Assignees

> Returns the number of tasks assigned to each assignee, sorted by count descending. All filter fields are optional and supplied at the top level; an empty body ({}) returns counts across all assignees. Set assigneeType to restrict results to a single assignee kind. The underlying route requires the CAN_VIEW_REPORTING permission — the API key acts as its default user.

Returns task counts grouped by assignee, sorted by count descending. Filters are optional and supplied at the top level; an empty body (`{}`) returns all assignees. Set `assigneeType` to `user`, `team`, or `location` to restrict the result to a single assignee kind. Requires the `CAN_VIEW_REPORTING` permission (inherited from the key's default user).


## OpenAPI

````yaml POST /api/v1/ops/reports/tasks/count-by-assignees
openapi: 3.1.0
info:
  title: Xenia Team API - Task Count by Assignees
  description: >-
    Returns task counts grouped by assignee (user, team, or location) for the
    workspace.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/ops/reports/tasks/count-by-assignees:
    post:
      tags:
        - Reporting
      summary: Task Count by Assignees
      description: >-
        Returns the number of tasks assigned to each assignee, sorted by count
        descending. All filter fields are optional and supplied at the top
        level; an empty body ({}) returns counts across all assignees. Set
        assigneeType to restrict results to a single assignee kind. The
        underlying route requires the CAN_VIEW_REPORTING permission — the API
        key acts as its default user.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                assigneeType:
                  type: string
                  enum:
                    - user
                    - team
                    - location
                  description: >-
                    Restrict results to a single assignee kind. When set,
                    unassigned tasks are excluded. When omitted, all kinds are
                    returned.
                fromDate:
                  type: string
                  format: date-time
                toDate:
                  type: string
                  format: date-time
                taskStatuses:
                  type: array
                  items:
                    type: string
                locations:
                  type: array
                  items:
                    type: string
                    format: uuid
                priorities:
                  type: array
                  items:
                    type: string
                categories:
                  type: array
                  items:
                    type: string
                    format: uuid
            example:
              assigneeType: user
      responses:
        '200':
          description: Task counts by assignee retrieved successfully.
          content:
            application/json:
              example:
                data:
                  - id: 183f639a-8358-485f-9abe-221d0efcbe8e
                    assignee: Jane Doe
                    count: 57
                    assigneeType: user
                  - id: d3225f70-1c2b-4a8f-9e11-2233445566aa
                    assignee: Front Desk Team
                    count: 31
                    assigneeType: team
                meta: {}
        '401':
          description: >-
            Unauthorized - Invalid client credentials, or client does not belong
            to this workspace.
        '403':
          description: 'Forbidden: API key not authorized for this route.'
        '500':
          description: Internal Server Error.
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret

````