Leave Budgets

A leave budget records the amount of leave an employee has available to take.

Endpoints


get/api/v3/office/leave/budgets

Return a paginated list of office/leave/budgets

Input Schema

object
page?:
object
The page number, default to 1
number?: integer
The number of items per page, default to 1000
size?: integer
The sort order, comma separated list of fields. See sorting section for more details
sort?: string
Set to true to return the total number of items in the collection
count?: boolean
filter?:
object
id?: unknown
amount?: unknown
The related resources to include in the response. Allowed resources are:
- `employee`
- `events`
- `events.leave_request`
- `events.created_by`
included?:
array
Elements: string
The fields to include in the response.
The key is the resource type and the value is an array of fields.
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  page?: {
    // The page number, default to 1
    number?: number;
    // The number of items per page, default to 1000
    size?: number;
  };
  // The sort order, comma separated list of fields. See sorting section for more details
  sort?: string;
  // Set to true to return the total number of items in the collection
  count?: boolean;
  filter?: { id?: any; amount?: any };
  // The related resources to include in the response. Allowed resources are:
  // - `employee`
  // - `events`
  // - `events.leave_request`
  // - `events.created_by`
  included?: Array<string>;
  // The fields to include in the response.
  // The key is the resource type and the value is an array of fields.
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
array
Elements:
object
type: string
id?: string
attributes?:
object
id?: integer
amount?: integer
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: Array<{
    type: string;
    id?: string;
    attributes?: { id?: number; amount?: number };
    relationships?: Record<string, any>;
  }>;
  included?: Array<Record<string, any>>;
};


post/api/v3/office/leave/budgets/:id/update

Update the leave budget for an employee. A budget event will be created to record the change.

Input Schema

object
id: integer
data:
object
attributes:
object
amount: number
reason?: string

Typescript

type InputSchema = {
  id: number;
  data: { attributes: { amount: number; reason?: string } };
};


get/api/v3/office/leave/budgets/:resource_id

Show a specific office/leave/budgets

Input Schema

object
resource_id: integer
included?:
array
Elements: string
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  resource_id: number;
  included?: Array<string>;
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
object
type: string
id?: string
attributes?:
object
id?: integer
amount?: integer
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: {
    type: string;
    id?: string;
    attributes?: { id?: number; amount?: number };
    relationships?: Record<string, any>;
  };
  included?: Array<Record<string, any>>;
};


get/api/v3/office/leave/budgets/export

Get consolidated report for leave balance purposes. Return an excel file.

Input Schema

object
from: date
to: date

Typescript

type InputSchema = { from: Date; to: Date };


get/api/v3/office/leave/budgets/summary

Input Schema

object
filters:
object
employee_id: integer
start_date: date
end_date: date

Typescript

type InputSchema = {
  filters: { employee_id: number; start_date: Date; end_date: Date };
};