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

> Returns the number of tasks in each status for the workspace. All filter fields are optional and supplied at the top level of the body; an empty body ({}) returns counts across all tasks. The Open bucket also includes a week-over-week creation trend. The underlying route requires the CAN_VIEW_REPORTING permission — the API key acts as its default user.

Returns task counts grouped by task status. Filter fields are optional and supplied at the top level of the body; an empty body (`{}`) counts all tasks. The `Open` bucket additionally carries a week-over-week creation `trend`. Requires the `CAN_VIEW_REPORTING` permission (inherited from the key's default user).


## OpenAPI

````yaml POST /api/v1/ops/reports/tasks/count-by-status
openapi: 3.1.0
info:
  title: Xenia Team API - Task Count by Status
  description: Returns task counts grouped by task status for the workspace.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/ops/reports/tasks/count-by-status:
    post:
      tags:
        - Reporting
      summary: Task Count by Status
      description: >-
        Returns the number of tasks in each status for the workspace. All filter
        fields are optional and supplied at the top level of the body; an empty
        body ({}) returns counts across all tasks. The Open bucket also includes
        a week-over-week creation trend. 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:
                fromDate:
                  type: string
                  format: date-time
                  description: Start of the task date range.
                toDate:
                  type: string
                  format: date-time
                  description: End of the task date range.
                assignees:
                  type: array
                  items:
                    type: string
                  description: >-
                    Assignee UUIDs (user, team, role, or location IDs). Use
                    "unassigned" to include unassigned tasks.
                createdBy:
                  type: array
                  items:
                    type: string
                    format: uuid
                completedBy:
                  type: array
                  items:
                    type: string
                    format: uuid
                taskStatuses:
                  type: array
                  items:
                    type: string
                  description: >-
                    Task statuses to include, e.g. "Open", "In Progress",
                    "Completed", "Missed".
                locations:
                  type: array
                  items:
                    type: string
                    format: uuid
                priorities:
                  type: array
                  items:
                    type: string
                categories:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Category (ServiceType) UUIDs.
                dueFilter:
                  type: object
                  description: >-
                    Due-date filter. Provide one of the boolean flags or a dates
                    range.
                  properties:
                    overDue:
                      type: boolean
                    notOverDue:
                      type: boolean
                    noDueDate:
                      type: boolean
                    hasDueDate:
                      type: boolean
                    dueToday:
                      type: boolean
                    dates:
                      type: object
                      properties:
                        from:
                          type: string
                          format: date-time
                        to:
                          type: string
                          format: date-time
            example:
              locations:
                - 46715d09-1628-4b1a-a12d-f9e0bbcdbc3c
              taskStatuses: []
      responses:
        '200':
          description: >-
            Task counts by status retrieved successfully. Each status maps to an
            object with a count; the Open bucket also carries a trend.
          content:
            application/json:
              example:
                data:
                  Open:
                    count: 42
                    trend:
                      change: 12
                  In Progress:
                    count: 9
                  Completed:
                    count: 318
                  Missed:
                    count: 7
                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

````