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

# Schedule Completion by Location

> Returns per-location recurring-task counts by status plus on-time/late/incomplete percentages. Data is scoped to the caller's authorized site locations; when locationLevelId is provided, site data is rolled up to that hierarchy level. The underlying route requires the CAN_VIEW_REPORTING permission — the API key acts as its default user.

Returns per-location recurring-task status counts plus on-time, late, and incomplete percentages, with an overall completed-on-time summary. Filters are wrapped under `filters`; pass `locationLevelId` to roll site-location data up to a hierarchy level. Data is scoped to the caller's authorized locations. Requires the `CAN_VIEW_REPORTING` permission (inherited from the key's default user).


## OpenAPI

````yaml POST /api/v1/ops/reports/tasks/schedule-completion-by-location
openapi: 3.1.0
info:
  title: Xenia Team API - Schedule Completion by Location
  description: >-
    Returns recurring-task status breakdown and completion percentages per
    location.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/ops/reports/tasks/schedule-completion-by-location:
    post:
      tags:
        - Reporting
      summary: Schedule Completion by Location
      description: >-
        Returns per-location recurring-task counts by status plus
        on-time/late/incomplete percentages. Data is scoped to the caller's
        authorized site locations; when locationLevelId is provided, site data
        is rolled up to that hierarchy level. 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:
                filters:
                  type: object
                  properties:
                    dateRange:
                      type: array
                      items:
                        type: string
                        format: date-time
                    locations:
                      type: array
                      items:
                        type: string
                        format: uuid
                    project:
                      type: array
                      items:
                        type: string
                        format: uuid
                locationLevelId:
                  type: string
                  format: uuid
                  description: >-
                    Optional hierarchy level UUID. When set, site-location data
                    is rolled up to locations at this level.
            example:
              filters:
                dateRange:
                  - '2025-06-01T00:00:00.000Z'
                  - '2025-06-30T23:59:59.999Z'
                locations: []
                project: []
      responses:
        '200':
          description: Schedule completion by location retrieved successfully.
          content:
            application/json:
              example:
                data:
                  charts:
                    - id: 46715d09-1628-4b1a-a12d-f9e0bbcdbc3c
                      name: Chicago Downtown
                      totalTasks: 220
                      Open_Count: 12
                      InProgress_Count: 5
                      OnHold_Count: 2
                      Completed_Count: 195
                      Missed_Count: 6
                      CompletedOnTime_Percent: 84.09
                      CompletedLate_Percent: 4.55
                      Incomplete_Percent: 11.36
                  summary:
                    completedOnTime: 84.09
                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

````