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

# List employees (filtered, sorted, paginated)

> List employees (filtered, sorted, paginated)



## OpenAPI

````yaml /api-reference/openapi.json get /api/employees
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:
    get:
      tags:
        - Employees
      summary: List employees (filtered, sorted, paginated)
      description: List employees (filtered, sorted, paginated)
      operationId: getApiEmployees
      parameters:
        - 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: search
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: employmentType
          schema:
            type: string
        - in: query
          name: departmentId
          schema:
            type: string
        - in: query
          name: locationId
          schema:
            type: string
        - in: query
          name: managerId
          schema:
            type: string
        - in: query
          name: tags
          schema:
            type: string
        - in: query
          name: branch
          schema:
            type: string
        - in: query
          name: reportsTo
          schema:
            type: string
        - in: query
          name: tenureMinMonths
          schema:
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - in: query
          name: tenureMaxMonths
          schema:
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - in: query
          name: designation
          schema:
            type: string
        - in: query
          name: grade
          schema:
            type: string
        - in: query
          name: joinedFrom
          schema:
            type: string
        - in: query
          name: joinedTo
          schema:
            type: string
        - in: query
          name: ctcMin
          schema:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
        - in: query
          name: ctcMax
          schema:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
        - in: query
          name: sortField
          schema:
            default: code
            type: string
            enum:
              - code
              - fullName
              - designation
              - department
              - location
              - manager
              - joinedDate
              - status
              - ctcAnnual
        - in: query
          name: sortDir
          schema:
            default: asc
            type: string
            enum:
              - asc
              - desc
      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)$
                        code:
                          type: string
                          minLength: 1
                        fullName:
                          type: string
                          minLength: 1
                        email:
                          type: string
                          format: email
                          pattern: >-
                            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        mobile:
                          type: string
                        designation:
                          type: string
                        departmentId:
                          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'
                        locationId:
                          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'
                        managerId:
                          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'
                        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'
                        employmentType:
                          type: string
                          enum:
                            - FullTime
                            - Probation
                            - Contract
                        joinedDate:
                          type: string
                          pattern: ^\d{4}-\d{2}-\d{2}$
                        status:
                          type: string
                          enum:
                            - Active
                            - Probation
                            - Onboarding
                            - Exited
                        exitDate:
                          anyOf:
                            - type: string
                              pattern: ^\d{4}-\d{2}-\d{2}$
                            - type: 'null'
                        roleId:
                          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)$
                        firstName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        middleName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        lastName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        preferredName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        dob:
                          anyOf:
                            - type: string
                              pattern: ^\d{4}-\d{2}-\d{2}$
                            - type: 'null'
                        gender:
                          anyOf:
                            - type: string
                              enum:
                                - Male
                                - Female
                                - Other
                                - Undisclosed
                            - type: 'null'
                        maritalStatus:
                          anyOf:
                            - type: string
                              enum:
                                - Single
                                - Married
                                - Other
                            - type: 'null'
                        personalEmail:
                          anyOf:
                            - type: string
                            - type: 'null'
                        personalPhone:
                          anyOf:
                            - type: string
                            - type: 'null'
                        address:
                          anyOf:
                            - type: string
                            - type: 'null'
                        city:
                          anyOf:
                            - type: string
                            - type: 'null'
                        state:
                          anyOf:
                            - type: string
                            - type: 'null'
                        pincode:
                          anyOf:
                            - type: string
                            - type: 'null'
                        pan:
                          anyOf:
                            - type: string
                            - type: 'null'
                        aadhaarLast4:
                          anyOf:
                            - type: string
                            - type: 'null'
                        pfUan:
                          anyOf:
                            - type: string
                            - type: 'null'
                        esiNumber:
                          anyOf:
                            - type: string
                            - type: 'null'
                        emergencyName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        emergencyRelationship:
                          anyOf:
                            - type: string
                            - type: 'null'
                        emergencyPhone:
                          anyOf:
                            - type: string
                            - type: 'null'
                        subDepartment:
                          anyOf:
                            - type: string
                            - type: 'null'
                        grade:
                          anyOf:
                            - type: string
                            - type: 'null'
                        probationEndDate:
                          anyOf:
                            - type: string
                              pattern: ^\d{4}-\d{2}-\d{2}$
                            - type: 'null'
                        branch:
                          anyOf:
                            - type: string
                            - type: 'null'
                        tags:
                          type: array
                          items:
                            type: string
                        ctcAnnual:
                          anyOf:
                            - type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            - type: 'null'
                        payFrequency:
                          anyOf:
                            - type: string
                              enum:
                                - Monthly
                                - Biweekly
                                - Weekly
                            - type: 'null'
                        bankName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        bankAccountHolder:
                          anyOf:
                            - type: string
                            - type: 'null'
                        bankAccountNumber:
                          anyOf:
                            - type: string
                            - type: 'null'
                        ifsc:
                          anyOf:
                            - type: string
                            - type: 'null'
                      required:
                        - id
                        - code
                        - fullName
                        - email
                        - mobile
                        - designation
                        - departmentId
                        - locationId
                        - managerId
                        - shiftTemplateId
                        - employmentType
                        - joinedDate
                        - status
                        - exitDate
                        - roleId
                        - firstName
                        - middleName
                        - lastName
                        - preferredName
                        - dob
                        - gender
                        - maritalStatus
                        - personalEmail
                        - personalPhone
                        - address
                        - city
                        - state
                        - pincode
                        - emergencyName
                        - emergencyRelationship
                        - emergencyPhone
                        - subDepartment
                        - grade
                        - probationEndDate
                        - branch
                        - tags
                        - payFrequency
                        - bankName
                        - bankAccountHolder
                  total:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  page:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  pageSize:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  kpis:
                    type: object
                    properties:
                      headcount:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      active:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      onboarding:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      probation:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      exited:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      avgTenureYears:
                        type: number
                    required:
                      - headcount
                      - active
                      - onboarding
                      - probation
                      - exited
                      - avgTenureYears
                required:
                  - items
                  - total
                  - page
                  - pageSize
                  - kpis
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.

````