curl -X GET https://api.companyflow.com/leave-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer YOUR_TOKEN"
const leaveRequestId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(
`https://api.companyflow.com/leave-requests/${leaveRequestId}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
leave_request_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
url = f'https://api.companyflow.com/leave-requests/{leave_request_id}'
headers = {'Authorization': 'Bearer YOUR_TOKEN'}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-03-15T00:00:00Z",
"endDate": "2025-03-19T00:00:00Z",
"daysRequested": 5,
"reason": "Family vacation",
"attachmentUrl": null,
"status": "pending",
"currentStep": 1,
"approvedBy": null,
"approvedAt": null,
"rejectionReason": "",
"createdAt": "2025-03-03T10:30:00Z",
"updatedAt": "2025-03-03T10:30:00Z"
}
}
{
"success": true,
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "234f5678-f90c-23e4-b567-537725285111",
"startDate": "2025-02-10T00:00:00Z",
"endDate": "2025-02-12T00:00:00Z",
"daysRequested": 3,
"reason": "Medical appointment",
"attachmentUrl": "https://storage.example.com/medical-cert.pdf",
"status": "approved",
"currentStep": 2,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": "2025-02-08T14:20:00Z",
"rejectionReason": "",
"createdAt": "2025-02-05T09:15:00Z",
"updatedAt": "2025-02-08T14:20:00Z"
}
}
{
"success": true,
"data": {
"id": "c3d4e5f6-a7b8-9012-cdef-23456789012",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-04-01T00:00:00Z",
"endDate": "2025-04-05T00:00:00Z",
"daysRequested": 5,
"reason": "Personal reasons",
"attachmentUrl": null,
"status": "rejected",
"currentStep": 1,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": null,
"rejectionReason": "Team is understaffed during this period. Please request alternative dates.",
"createdAt": "2025-03-01T08:00:00Z",
"updatedAt": "2025-03-02T11:45:00Z"
}
}
Leave Requests
Get Leave Request
Retrieve details of a specific leave request by ID
GET
/
leave-requests
/
{id}
curl -X GET https://api.companyflow.com/leave-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer YOUR_TOKEN"
const leaveRequestId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(
`https://api.companyflow.com/leave-requests/${leaveRequestId}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
leave_request_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
url = f'https://api.companyflow.com/leave-requests/{leave_request_id}'
headers = {'Authorization': 'Bearer YOUR_TOKEN'}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-03-15T00:00:00Z",
"endDate": "2025-03-19T00:00:00Z",
"daysRequested": 5,
"reason": "Family vacation",
"attachmentUrl": null,
"status": "pending",
"currentStep": 1,
"approvedBy": null,
"approvedAt": null,
"rejectionReason": "",
"createdAt": "2025-03-03T10:30:00Z",
"updatedAt": "2025-03-03T10:30:00Z"
}
}
{
"success": true,
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "234f5678-f90c-23e4-b567-537725285111",
"startDate": "2025-02-10T00:00:00Z",
"endDate": "2025-02-12T00:00:00Z",
"daysRequested": 3,
"reason": "Medical appointment",
"attachmentUrl": "https://storage.example.com/medical-cert.pdf",
"status": "approved",
"currentStep": 2,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": "2025-02-08T14:20:00Z",
"rejectionReason": "",
"createdAt": "2025-02-05T09:15:00Z",
"updatedAt": "2025-02-08T14:20:00Z"
}
}
{
"success": true,
"data": {
"id": "c3d4e5f6-a7b8-9012-cdef-23456789012",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-04-01T00:00:00Z",
"endDate": "2025-04-05T00:00:00Z",
"daysRequested": 5,
"reason": "Personal reasons",
"attachmentUrl": null,
"status": "rejected",
"currentStep": 1,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": null,
"rejectionReason": "Team is understaffed during this period. Please request alternative dates.",
"createdAt": "2025-03-01T08:00:00Z",
"updatedAt": "2025-03-02T11:45:00Z"
}
}
Overview
Fetch complete details of a single leave request including approval history, attached documents, and current status.Authentication
Requires authentication with Bearer token. Available to:- SuperAdmin
- HR Manager
- Manager
- Employee (own requests only)
Path parameters
string
required
UUID of the leave request to retrieve
Response
boolean
Indicates if the request was successful
object
The leave request object
Show LeaveRequest properties
Show LeaveRequest properties
string
Unique identifier for the leave request
string
UUID of the employee who submitted the request
string
UUID of the leave type
string
Leave start date (ISO 8601 format)
string
Leave end date (ISO 8601 format)
number
Number of days requested (supports decimals for half days)
string
Reason provided for the leave request
string
URL to attached documentation (e.g., medical certificate). Null if no attachment.
string
Current status of the request:
pending- Awaiting approvalapproved- Approved by managerrejected- Rejected by managercancelled- Cancelled by systemwithdrawn- Withdrawn by employee
integer
Current step in the approval workflow (1-based index)
string
UUID of the manager who approved the request. Null if not yet approved.
string
Timestamp when the request was approved (ISO 8601). Null if not yet approved.
string
Explanation provided by manager if request was rejected. Empty string if not rejected.
string
Timestamp when the request was created (ISO 8601)
string
Timestamp of the last update (ISO 8601)
curl -X GET https://api.companyflow.com/leave-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer YOUR_TOKEN"
const leaveRequestId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(
`https://api.companyflow.com/leave-requests/${leaveRequestId}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
}
);
const data = await response.json();
import requests
leave_request_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
url = f'https://api.companyflow.com/leave-requests/{leave_request_id}'
headers = {'Authorization': 'Bearer YOUR_TOKEN'}
response = requests.get(url, headers=headers)
data = response.json()
{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-03-15T00:00:00Z",
"endDate": "2025-03-19T00:00:00Z",
"daysRequested": 5,
"reason": "Family vacation",
"attachmentUrl": null,
"status": "pending",
"currentStep": 1,
"approvedBy": null,
"approvedAt": null,
"rejectionReason": "",
"createdAt": "2025-03-03T10:30:00Z",
"updatedAt": "2025-03-03T10:30:00Z"
}
}
{
"success": true,
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "234f5678-f90c-23e4-b567-537725285111",
"startDate": "2025-02-10T00:00:00Z",
"endDate": "2025-02-12T00:00:00Z",
"daysRequested": 3,
"reason": "Medical appointment",
"attachmentUrl": "https://storage.example.com/medical-cert.pdf",
"status": "approved",
"currentStep": 2,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": "2025-02-08T14:20:00Z",
"rejectionReason": "",
"createdAt": "2025-02-05T09:15:00Z",
"updatedAt": "2025-02-08T14:20:00Z"
}
}
{
"success": true,
"data": {
"id": "c3d4e5f6-a7b8-9012-cdef-23456789012",
"employeeId": "987e6543-e21b-12d3-a456-426614174000",
"leaveTypeId": "123e4567-e89b-12d3-a456-426614174000",
"startDate": "2025-04-01T00:00:00Z",
"endDate": "2025-04-05T00:00:00Z",
"daysRequested": 5,
"reason": "Personal reasons",
"attachmentUrl": null,
"status": "rejected",
"currentStep": 1,
"approvedBy": "345a6789-a01d-34f5-c678-648836396222",
"approvedAt": null,
"rejectionReason": "Team is understaffed during this period. Please request alternative dates.",
"createdAt": "2025-03-01T08:00:00Z",
"updatedAt": "2025-03-02T11:45:00Z"
}
}
Status definitions
pending
pending
Leave request has been submitted and is awaiting manager review. Employee can still withdraw the request at this stage.
approved
approved
Manager has approved the request. Leave days are deducted from the employee’s balance and the leave is confirmed.
rejected
rejected
Manager has rejected the request with a reason. No balance deduction occurs. Employee can submit a new request with different dates.
withdrawn
withdrawn
Employee has withdrawn their pending request before manager approval. No balance impact.
cancelled
cancelled
System-cancelled due to policy changes or employee departure. Rare status for administrative purposes.
Related operations
After retrieving a leave request, you may want to:Approve request
Approve a pending leave request (managers only)
Reject request
Reject a pending leave request with reason
Withdraw request
Employee can withdraw their own pending request
Check balance
View remaining leave balance for the employee
Error responses
{
"success": false,
"message": "leave request not found"
}
{
"success": false,
"message": "unauthorized access to this leave request"
}
{
"success": false,
"message": "invalid request id"
}