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

# Weekly roster grid (employees × 7 days) + KPIs

> Weekly roster grid (employees × 7 days) + KPIs



## OpenAPI

````yaml /api-reference/openapi.json get /api/rosters
openapi: 3.1.0
info:
  title: ontime API
  description: APIs for ontime.v2
  version: 1.0.0
servers:
  - url: https://app.ontime.hosai.app
    description: Production
security:
  - apiKey: []
paths:
  /api/rosters:
    get:
      tags:
        - Rosters
      summary: Weekly roster grid (employees × 7 days) + KPIs
      description: Weekly roster grid (employees × 7 days) + KPIs
      operationId: getApiRosters
      parameters:
        - in: query
          name: weekStart
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: true
        - in: query
          name: locationId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - in: query
          name: departmentId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  weekStart:
                    type: string
                  days:
                    type: array
                    items:
                      type: string
                  published:
                    type: boolean
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        employeeId:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        name:
                          type: string
                        code:
                          type: string
                        locationName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        departmentName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        isManager:
                          type: boolean
                        cells:
                          type: array
                          items:
                            anyOf:
                              - type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                  employeeId:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                  date:
                                    type: string
                                  weekStart:
                                    type: string
                                  state:
                                    type: string
                                    enum:
                                      - Working
                                      - 'Off'
                                      - Leave
                                  shiftTemplateId:
                                    anyOf:
                                      - type: string
                                        format: uuid
                                        pattern: >-
                                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                      - type: 'null'
                                  published:
                                    type: boolean
                                  note:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - id
                                  - employeeId
                                  - date
                                  - weekStart
                                  - state
                                  - shiftTemplateId
                                  - published
                                  - note
                              - type: 'null'
                      required:
                        - employeeId
                        - name
                        - code
                        - locationName
                        - departmentName
                        - isManager
                        - cells
                  templates:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        name:
                          type: string
                        category:
                          type: string
                          enum:
                            - G
                            - M
                            - E
                            - 'N'
                            - F
                            - FL
                        startTime:
                          type: string
                        endTime:
                          type: string
                      required:
                        - id
                        - name
                        - category
                        - startTime
                        - endTime
                  kpis:
                    type: object
                    properties:
                      employeesTotal:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      assigned:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      unassigned:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      onLeave:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      perDayStaffed:
                        type: array
                        items:
                          type: object
                          properties:
                            date:
                              type: string
                            staffed:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            onLeave:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - date
                            - staffed
                            - onLeave
                      shiftLoadByCategory:
                        type: array
                        items:
                          type: object
                          properties:
                            category:
                              type: string
                              enum:
                                - G
                                - M
                                - E
                                - 'N'
                                - F
                                - FL
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - category
                            - count
                    required:
                      - employeesTotal
                      - assigned
                      - unassigned
                      - onLeave
                      - perDayStaffed
                      - shiftLoadByCategory
                  holidays:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                        name:
                          type: string
                        type:
                          type: string
                      required:
                        - date
                        - name
                        - type
                  projection:
                    type: object
                    properties:
                      conflictCount:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      conflicts:
                        type: array
                        items:
                          type: object
                          properties:
                            employeeId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            employeeName:
                              type: string
                            date:
                              type: string
                            kind:
                              type: string
                              enum:
                                - double-book
                                - leave-clash
                                - weekly-off
                            detail:
                              type: string
                          required:
                            - employeeId
                            - employeeName
                            - date
                            - kind
                            - detail
                      estOtHours:
                        type: number
                      estPayroll:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - conflictCount
                      - conflicts
                      - estOtHours
                      - estPayroll
                required:
                  - weekStart
                  - days
                  - published
                  - rows
                  - templates
                  - kpis
                  - holidays
                  - projection
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: ont_ API key
      description: >-
        Issue keys in Settings → API. Send them as `Authorization: Bearer ont_…`
        (an `X-Api-Key: ont_…` header is also accepted). Session-cookie routes
        are used by the OnTime web apps and are shown for completeness.

````