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

# Weekly Completion

> Returns completion percentages per recurring schedule (or per project) for each of four weeks. The window ends at filters.dateRange[1] (or today) and can be paged forward/backward with page. The underlying route requires the CAN_VIEW_REPORTING permission — the API key acts as its default user.

Returns per-schedule (or per-project) completion percentages across a rolling four-week window. Filters are wrapped under `filters`, whose `dateRange[1]` anchors the window; `page` shifts the window forward (positive) or backward (negative). Requires the `CAN_VIEW_REPORTING` permission (inherited from the key's default user).


## OpenAPI

````yaml POST /api/v1/ops/reports/tasks/weekly-completion
openapi: 3.1.0
info:
  title: Xenia Team API - Weekly Completion
  description: >-
    Returns per-schedule (or per-project) task completion percentages across a
    rolling 4-week window.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/ops/reports/tasks/weekly-completion:
    post:
      tags:
        - Reporting
      summary: Weekly Completion
      description: >-
        Returns completion percentages per recurring schedule (or per project)
        for each of four weeks. The window ends at filters.dateRange[1] (or
        today) and can be paged forward/backward with page. 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
                  description: >-
                    Global report filters. dateRange[1] anchors the 4-week
                    window.
                  properties:
                    dateRange:
                      type: array
                      items:
                        type: string
                        format: date-time
                      description: '[from, to] range. The window ends at the second element.'
                    locations:
                      type: array
                      items:
                        type: string
                        format: uuid
                    project:
                      type: array
                      items:
                        type: string
                        format: uuid
                view:
                  type: string
                  enum:
                    - schedules
                    - projects
                  default: schedules
                  description: Group rows by recurring schedule or by project.
                page:
                  type: integer
                  default: 0
                  description: >-
                    0 = current 4 weeks; positive = future weeks; negative =
                    past weeks.
            example:
              filters:
                dateRange:
                  - '2025-06-01T00:00:00.000Z'
                  - '2025-06-30T23:59:59.999Z'
                locations: []
                project: []
              view: schedules
              page: 0
      responses:
        '200':
          description: Weekly completion data retrieved successfully.
          content:
            application/json:
              example:
                data:
                  items:
                    - id: sched-2f9a1c22-1d4e-4b6a-9c11
                      title: Restroom Inspection
                      schedule: true
                      recurringByEvery: daily
                      startTime: '08:00'
                      dueTime: '10:00'
                      weeklyCompletion:
                        - date: 6/7
                          startDate: '2025-06-01'
                          endDate: '2025-06-07'
                          percentage: 100
                        - date: 6/14
                          startDate: '2025-06-08'
                          endDate: '2025-06-14'
                          percentage: 86
                        - date: 6/21
                          startDate: '2025-06-15'
                          endDate: '2025-06-21'
                          percentage: 71
                        - date: 6/28
                          startDate: '2025-06-22'
                          endDate: '2025-06-28'
                          percentage: 90
                  weeks:
                    - 6/7
                    - 6/14
                    - 6/21
                    - 6/28
                  endDate: '2025-06-30'
                  page: 0
                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

````