Skip to main content
GET
/
leave-requests
/
{id}
curl -X GET https://api.companyflow.com/leave-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "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"
  }
}

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

id
string
required
UUID of the leave request to retrieve

Response

success
boolean
Indicates if the request was successful
data
object
The leave request object
curl -X GET https://api.companyflow.com/leave-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "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"
  }
}

Status definitions

Leave request has been submitted and is awaiting manager review. Employee can still withdraw the request at this stage.
Manager has approved the request. Leave days are deducted from the employee’s balance and the leave is confirmed.
Manager has rejected the request with a reason. No balance deduction occurs. Employee can submit a new request with different dates.
Employee has withdrawn their pending request before manager approval. No balance impact.
System-cancelled due to policy changes or employee departure. Rare status for administrative purposes.
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"
}

Build docs developers (and LLMs) love