Skip to main content

Submit Approval Action API

Overview​

Allows a designated manager (Manager 1, Manager 2, or Manager 3) to submit an APPROVED or REJECTED decision on a pending booking request.

[!IMPORTANT] First Responder Logic: Only one approval is needed to book the request. If any manager (even if it's an escalated Manager 2 or 3) clicks APPROVED, the request is instantly fully approved and no further manager action is needed.

  • Endpoint: /api/approval-policies/action
  • Method: POST
  • Access: Approving Manager / Corporate Admin

Request Body Schema​

FieldTypeRequiredDescription
bookingIdString (UUID)YesTarget booking ID
approverIdString (UUID)YesUser ID of the approving manager
actionEnumYesAPPROVED or REJECTED
commentsStringNoOptional comments or justification

Request Body Example​

{
"bookingId": "b1234567-89ab-cdef-0123-456789abcdef",
"approverId": "u1234567-89ab-cdef-0123-456789abcdef",
"action": "APPROVED",
"comments": "Approved by Manager 1"
}

Success Response (200 OK)​

{
"success": true,
"message": "Booking request fully approved",
"data": {
"status": "APPROVED",
"message": "Booking request fully approved"
}
}

Database Impact​

  • Tables: approval_journeys, approval_histories, bookings
  • Operations: Updates active ApprovalHistory and ApprovalJourney status. Updates Booking status to APPROVED or CANCELLED.