curl -X GET "https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = 'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types'
headers = {
'Authorization': 'Bearer YOUR_TOKEN'
}
params = {
'page': 1,
'pageSize': 10,
'status': 'active'
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Annual Leave",
"code": "AL",
"description": "Paid annual vacation time for all employees",
"days_allowed": 20,
"is_paid": true,
"requires_documentation": false,
"carry_forward_allowed": true,
"max_carry_forward_days": 5,
"color_code": "#3B82F6",
"status": "active",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sick Leave",
"code": "SL",
"description": "Paid sick leave with medical certificate",
"days_allowed": 10,
"is_paid": true,
"requires_documentation": true,
"carry_forward_allowed": false,
"max_carry_forward_days": 0,
"color_code": "#EF4444",
"status": "active",
"created_at": "2025-01-15T10:35:00Z",
"updated_at": "2025-01-15T10:35:00Z"
}
],
"total": 2,
"page": 1,
"pageSize": 10,
"totalPages": 1
}
}
{
"success": false,
"message": "invalid company_id"
}
{
"success": false,
"message": "unauthorized"
}
Leave Types
List Leave Types
Get paginated list of leave types for a company
GET
/
companies
/
{company_id}
/
leave-types
curl -X GET "https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = 'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types'
headers = {
'Authorization': 'Bearer YOUR_TOKEN'
}
params = {
'page': 1,
'pageSize': 10,
'status': 'active'
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Annual Leave",
"code": "AL",
"description": "Paid annual vacation time for all employees",
"days_allowed": 20,
"is_paid": true,
"requires_documentation": false,
"carry_forward_allowed": true,
"max_carry_forward_days": 5,
"color_code": "#3B82F6",
"status": "active",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sick Leave",
"code": "SL",
"description": "Paid sick leave with medical certificate",
"days_allowed": 10,
"is_paid": true,
"requires_documentation": true,
"carry_forward_allowed": false,
"max_carry_forward_days": 0,
"color_code": "#EF4444",
"status": "active",
"created_at": "2025-01-15T10:35:00Z",
"updated_at": "2025-01-15T10:35:00Z"
}
],
"total": 2,
"page": 1,
"pageSize": 10,
"totalPages": 1
}
}
{
"success": false,
"message": "invalid company_id"
}
{
"success": false,
"message": "unauthorized"
}
Retrieve a list of all leave types configured for a company with support for pagination, filtering, and search.
Authentication
Requires authentication with Bearer token. Available to:- Super Admin
- HR Manager
- Employee
- Manager
Path Parameters
string
required
The unique identifier of the company (UUID format)Example:
"123e4567-e89b-12d3-a456-426614174000"Query Parameters
integer
Page number for pagination (starts at 1)Default:
1integer
Number of items per pageDefault:
10string
Filter by leave type status:
active or inactiveExample: "active"string
Search by name or code (case-insensitive)Example:
"annual"Response
boolean
Indicates if the request was successful
object
Paginated list of leave types
Show Pagination Object
Show Pagination Object
array
Array of leave type objects
Show LeaveType properties
Show LeaveType properties
string
Unique identifier for the leave type
string
UUID of the company
string
Name of the leave type
string
Short code for the leave type
string
Detailed description
number
Total days allowed per year
boolean
Whether the leave is paid
boolean
Whether documentation is required
boolean
Whether carry forward is allowed
number
Maximum carry forward days
string
Hex color code
string
Status: active or inactive
string
ISO 8601 timestamp
string
ISO 8601 timestamp
integer
Total number of leave types matching the filters
integer
Current page number
integer
Number of items per page
integer
Total number of pages
curl -X GET "https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch(
'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types?page=1&pageSize=10&status=active',
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
url = 'https://api.companyflow.com/companies/123e4567-e89b-12d3-a456-426614174000/leave-types'
headers = {
'Authorization': 'Bearer YOUR_TOKEN'
}
params = {
'page': 1,
'pageSize': 10,
'status': 'active'
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
{
"success": true,
"data": {
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Annual Leave",
"code": "AL",
"description": "Paid annual vacation time for all employees",
"days_allowed": 20,
"is_paid": true,
"requires_documentation": false,
"carry_forward_allowed": true,
"max_carry_forward_days": 5,
"color_code": "#3B82F6",
"status": "active",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"company_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Sick Leave",
"code": "SL",
"description": "Paid sick leave with medical certificate",
"days_allowed": 10,
"is_paid": true,
"requires_documentation": true,
"carry_forward_allowed": false,
"max_carry_forward_days": 0,
"color_code": "#EF4444",
"status": "active",
"created_at": "2025-01-15T10:35:00Z",
"updated_at": "2025-01-15T10:35:00Z"
}
],
"total": 2,
"page": 1,
"pageSize": 10,
"totalPages": 1
}
}
{
"success": false,
"message": "invalid company_id"
}
{
"success": false,
"message": "unauthorized"
}
Filtering and Search
Combine multiple query parameters to refine your results:
- Use
status=activeto see only active leave types - Use
search=sickto find leave types containing “sick” in name or code - Use pagination parameters to control result size