curl -X POST https://api.companyflow.com/leave-requests \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "leaveTypeId": "123e4567-e89b-12d3-a456-426614174000", "startDate": "2025-03-15", "endDate": "2025-03-19", "daysRequested": 5, "reason": "Family vacation", "attachment": "" }'
{ "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" } }
Submit a new leave request for approval
Show LeaveRequest properties
pending
approved
rejected
cancelled
withdrawn
Annual Leave
Sick Leave
Unpaid Leave
Maternity/Paternity Leave
Pending
Review
Final status
Balance update
{ "success": false, "message": "insufficient leave balance" }