Keka HR Leave API

The Leave API from Keka HR — 4 operation(s) for leave.

OpenAPI Specification

keka-leave-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Keka HR Assets Leave API
  description: REST API for the Keka HR and payroll platform covering employee records, attendance, leave, payroll, expense management, performance, recruitment, professional services automation, helpdesk, background verification, and rewards.
  version: v1
  contact:
    url: https://developers.keka.com/
  license:
    name: Keka Terms of Service
    url: https://www.keka.com/terms-of-service
servers:
- url: https://{tenant}.keka.com/api/v1
  description: Keka HR API
  variables:
    tenant:
      default: your-company
      description: Your Keka tenant subdomain
security:
- oauth2:
  - kekaapi
tags:
- name: Leave
paths:
  /api/v1/time/leaverequests:
    get:
      operationId: get_all_leave_requests
      summary: Get all leave requests
      tags:
      - Leave
      responses:
        '200':
          description: Successful response
      description: '<p>This API is used for fetching list of all leave requests in the organization between from and to date. If both from and to are not specified, last 30 days records are returned. From date should be before to date. The difference between from and to date cannot be more than 90 days.</p>

        <h2 id="enumerated-values">Enumerated Values</h2>

        <div class="click-to-expand-wrapper is-table-wrapper"><table>

        <thead>

        <tr>

        <th>SessionType</th>

        <th>LeaveRequestStatus</th>

        </tr>

        </thead>

        <tbody>

        <tr>

        <td>0 = FirstHalf  <br />1 = SecondHalf</td>

        <td>0 = Pending  <br />1 = Approved  <br />2 = Rejected  <br />3 = Cancelled  <br />4 = InApprovalProcess</td>

        </tr>

        </tbody>

        </table>

        </div>'
    post:
      operationId: create_leave_request
      summary: Create leave request
      tags:
      - Leave
      responses:
        '200':
          description: Successful response
      description: '<p>This API is used for creating leave request against an employee. Create an leave request and returns leave request identifier.</p>

        '
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                employeeId: 444d61be-76c5-4f82-9107-31aa32a2f5df
                requestedBy: 444d61be-76c5-4f82-9107-31aa32a2f5df
                fromDate: '2023-11-03'
                toDate: '2023-11-03'
                fromSession: 0
                toSession: 1
                leaveTypeId: ABBE47B9-1AEF-4364-91E9-50EAD6C22E95
                reason: Health Issue
                note: casual Leave
  /api/v1/time/leavetypes:
    get:
      operationId: get_all_leave_types
      summary: Get all leave types
      tags:
      - Leave
      responses:
        '200':
          description: Successful response
      description: '<p>This API is used for fetching list of all leave types.</p>

        <h2 id="enumerated-values">Enumerated Values</h2>

        <div class="click-to-expand-wrapper is-table-wrapper"><table>

        <thead>

        <tr>

        <th>SessionType</th>

        <th>LeaveRequestStatus</th>

        </tr>

        </thead>

        <tbody>

        <tr>

        <td>0 = FirstHalf  <br />1 = SecondHalf</td>

        <td>0 = Pending  <br />1 = Approved  <br />2 = Rejected  <br />3 = Cancelled  <br />4 = InApprovalProcess</td>

        </tr>

        </tbody>

        </table>

        </div>'
  /api/v1/time/leavebalance:
    get:
      operationId: get_all_leave_balance
      summary: Get All Leave Balance
      tags:
      - Leave
      responses:
        '200':
          description: Successful response
  /api/v1/time/leaveplans:
    get:
      operationId: get_all_leave_plans
      summary: Get All Leave Plans
      tags:
      - Leave
      responses:
        '200':
          description: Successful response
components:
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 client credentials flow
      flows:
        clientCredentials:
          tokenUrl: https://login.keka.com/connect/token
          scopes:
            kekaapi: Access to Keka HR API