Documentation Index Fetch the complete documentation index at: https://mintlify.com/Falasefemi2/companyflow/llms.txt
Use this file to discover all available pages before exploring further.
Check the available leave balance for the authenticated employee for a specific leave type and year. This endpoint returns the number of available days that can be requested.
Authentication
Requires authentication with Bearer token. Available to:
This endpoint automatically uses the employee ID from the JWT token, so employees can only check their own balance.
Query Parameters
UUID of the leave type to check balance for Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
The year to check balance for (between 2020 and 2100) Example: 2025
Response
Indicates if the request was successful
Available leave days remaining (can include decimal values for half days) Example: 15.5
curl -X GET "https://api.companyflow.com/leave-balance?leaveTypeId=a1b2c3d4-e5f6-7890-abcd-ef1234567890&year=2025" \
-H "Authorization: Bearer YOUR_TOKEN"
200 - Success
400 - Bad Request (Missing leaveTypeId)
400 - Bad Request (Missing year)
400 - Bad Request (Invalid year)
401 - Unauthorized
500 - Internal Server Error
{
"success" : true ,
"data" : 15.5
}
Understanding the Balance
The returned balance represents:
Total allocated days for the year
Minus days already taken (approved leave)
Minus days pending approval
Plus any carried forward days from the previous year
Half-day leave is supported, so the balance can include decimal values like 15.5 (15 and a half days remaining).
Use Cases
This endpoint is typically used:
Before submitting a leave request to verify sufficient balance
In employee self-service portals to display available leave
In mobile apps for quick balance checks
When planning future leave requests
For a more detailed breakdown including total days, used days, and pending days, use the Get Balance by Type endpoint instead.