Skip to main content
GET
/
approval-history
Get Approval History
curl --request GET \
  --url https://api.example.com/approval-history
{
  "success": true,
  "data": [
    {
      "id": "aaa14567-e89b-12d3-a456-426614174000",
      "entityType": "leave_request",
      "entityId": "123e4567-e89b-12d3-a456-426614174000",
      "stepNumber": 1,
      "approverId": "789e4567-e89b-12d3-a456-426614174000",
      "action": "approved",
      "comments": "Approved for the requested dates",
      "createdAt": "2026-03-03T09:15:00Z"
    },
    {
      "id": "bbb14567-e89b-12d3-a456-426614174000",
      "entityType": "leave_request",
      "entityId": "123e4567-e89b-12d3-a456-426614174000",
      "stepNumber": 2,
      "approverId": "999e4567-e89b-12d3-a456-426614174000",
      "action": "approved",
      "comments": "Final approval granted",
      "createdAt": "2026-03-03T11:30:00Z"
    }
  ]
}

Overview

Retrieve the complete approval history for a specific entity (leave request or memo). This shows all approval actions taken, including who approved/rejected, when, and any comments provided.
Accessible to users with Super Admin, HR Manager, Manager, or Employee roles.

Query Parameters

entityType
string
required
Type of entity to get approval history for. Must be one of:
  • leave_request - For leave request approvals
  • memo - For memo approvals
entityId
uuid
required
The unique identifier of the entity (leave request ID or memo ID)

Response

success
boolean
Indicates if the request was successful
data
array
Array of approval history entries, ordered chronologically

Example Requests

Get approval history for a leave request

curl -X GET "https://api.companyflow.com/approval-history?entityType=leave_request&entityId=123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get approval history for a memo

curl -X GET "https://api.companyflow.com/approval-history?entityType=memo&entityId=456e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": [
    {
      "id": "aaa14567-e89b-12d3-a456-426614174000",
      "entityType": "leave_request",
      "entityId": "123e4567-e89b-12d3-a456-426614174000",
      "stepNumber": 1,
      "approverId": "789e4567-e89b-12d3-a456-426614174000",
      "action": "approved",
      "comments": "Approved for the requested dates",
      "createdAt": "2026-03-03T09:15:00Z"
    },
    {
      "id": "bbb14567-e89b-12d3-a456-426614174000",
      "entityType": "leave_request",
      "entityId": "123e4567-e89b-12d3-a456-426614174000",
      "stepNumber": 2,
      "approverId": "999e4567-e89b-12d3-a456-426614174000",
      "action": "approved",
      "comments": "Final approval granted",
      "createdAt": "2026-03-03T11:30:00Z"
    }
  ]
}

Understanding Approval Actions

Approved

The approver accepted the request and advanced it to the next step in the workflow. If this was the final step, the request is fully approved.

Rejected

The approver denied the request. This typically ends the approval process and the request status becomes “rejected”.

Requested Changes

The approver asked for modifications before they can approve. The submitter needs to update the request.

Workflow Step Tracking

The stepNumber field corresponds to the steps defined in the approval workflow:
1

Step 1

First approver in the workflow (e.g., direct manager)
2

Step 2

Second approver if multi-step workflow (e.g., department head)
3

Step 3+

Additional steps as defined in the workflow (e.g., HR manager, finance)
The approval history shows all actions taken, even if a request was rejected at step 1. This provides a complete audit trail of the approval process.

Use Cases

Use approval history to maintain compliance records showing who approved what and when. The comments field provides context for each decision.
Display approval progress to employees by showing which steps have been completed and who is the current pending approver.
Analyze approval patterns, average approval times per step, and which approvers tend to reject or request changes most frequently.

Error Responses

400 Bad Request
Missing required parameters (entityType or entityId), or invalid entityId format
401 Unauthorized
Missing or invalid authentication token
500 Internal Server Error
Server error while retrieving approval history

Build docs developers (and LLMs) love