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

# Per-employee audit log: paginated items with facets

> Per-employee audit log: paginated items with facets (per-category counts) and period window counts



## OpenAPI

````yaml /api-reference/openapi.json get /api/employees/{id}/audit
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/employees/{id}/audit:
    get:
      tags:
        - Audit
      summary: 'Per-employee audit log: paginated items with facets'
      description: >-
        Per-employee audit log: paginated items with facets (per-category
        counts) and period window counts
      operationId: getApiEmployeesByIdAudit
      parameters:
        - in: path
          name: id
          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)$
          required: true
        - in: query
          name: page
          schema:
            default: 1
            type: integer
            minimum: 1
            maximum: 9007199254740991
        - in: query
          name: pageSize
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
        - in: query
          name: category
          schema:
            type: string
            enum:
              - Profile
              - Compensation
              - Attendance
              - Leave
              - Documents
              - Devices
              - Permissions
              - Login
              - Payroll
              - Compliance
              - Other
        - in: query
          name: period
          schema:
            default: all
            type: string
            enum:
              - today
              - week
              - month
              - fy
              - all
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    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)$
                        orgId:
                          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)$
                        actorId:
                          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'
                        actorName:
                          type: string
                        resourceType:
                          type: string
                          enum:
                            - Employee
                            - Role
                            - AttendanceEvent
                            - DailyAttendance
                            - LeaveRequest
                            - LeaveType
                            - Regularization
                            - Overtime
                            - ShiftSwap
                            - Document
                            - EmployeeDevice
                            - Session
                            - Organization
                            - Roster
                            - Shift
                            - SalaryComponent
                            - PayrollCycle
                            - SalaryRevision
                            - PayrollLineOverride
                            - ComplianceFiling
                            - Form16Batch
                            - Integration
                            - Report
                            - ApiKey
                            - Webhook
                            - Device
                            - TerminalUserMap
                            - Other
                        resourceId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        subjectEmployeeId:
                          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'
                        action:
                          type: string
                          enum:
                            - Create
                            - Update
                            - Delete
                            - Approve
                            - Reject
                            - SignOut
                        category:
                          type: string
                          enum:
                            - Profile
                            - Compensation
                            - Attendance
                            - Leave
                            - Documents
                            - Devices
                            - Permissions
                            - Login
                            - Payroll
                            - Compliance
                            - Other
                        before:
                          anyOf:
                            - type: object
                              propertyNames:
                                type: string
                              additionalProperties: {}
                            - type: 'null'
                        after:
                          anyOf:
                            - type: object
                              propertyNames:
                                type: string
                              additionalProperties: {}
                            - type: 'null'
                        reason:
                          anyOf:
                            - type: string
                            - type: 'null'
                        at:
                          type: string
                      required:
                        - id
                        - orgId
                        - actorId
                        - actorName
                        - resourceType
                        - resourceId
                        - subjectEmployeeId
                        - action
                        - category
                        - before
                        - after
                        - reason
                        - at
                  total:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  page:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  pageSize:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  facets:
                    type: object
                    properties:
                      total:
                        type: number
                      Profile:
                        type: number
                      Compensation:
                        type: number
                      Attendance:
                        type: number
                      Leave:
                        type: number
                      Documents:
                        type: number
                      Devices:
                        type: number
                      Permissions:
                        type: number
                      Login:
                        type: number
                      Payroll:
                        type: number
                      Compliance:
                        type: number
                      Other:
                        type: number
                    required:
                      - total
                      - Profile
                      - Compensation
                      - Attendance
                      - Leave
                      - Documents
                      - Devices
                      - Permissions
                      - Login
                      - Payroll
                      - Compliance
                      - Other
                  periods:
                    type: object
                    properties:
                      today:
                        type: number
                      week:
                        type: number
                      month:
                        type: number
                      fy:
                        type: number
                      all:
                        type: number
                    required:
                      - today
                      - week
                      - month
                      - fy
                      - all
                required:
                  - items
                  - total
                  - page
                  - pageSize
                  - facets
                  - periods
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.

````