Skip to main content
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"
{
  "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
  }
}
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

company_id
string
required
The unique identifier of the company (UUID format)Example: "123e4567-e89b-12d3-a456-426614174000"

Query Parameters

page
integer
Page number for pagination (starts at 1)Default: 1
pageSize
integer
Number of items per pageDefault: 10
status
string
Filter by leave type status: active or inactiveExample: "active"
Search by name or code (case-insensitive)Example: "annual"

Response

success
boolean
Indicates if the request was successful
data
object
Paginated list of 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"
{
  "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
  }
}
Combine multiple query parameters to refine your results:
  • Use status=active to see only active leave types
  • Use search=sick to find leave types containing “sick” in name or code
  • Use pagination parameters to control result size

Build docs developers (and LLMs) love