Skip to main content

GET /api/v1/approvals

List approval requests filtered by status.

Query Parameters

ParameterTypeDefaultDescription
statusstring"pending"Filter by status: "pending", "approved", "rejected"

Response

[
  {
    "id": "approval_001",
    "entityType": "qualificationRule",
    "entityId": "qr_001",
    "entityName": "Credit Score Rule",
    "action": "update",
    "status": "pending",
    "requesterId": "user_001",
    "requesterName": "John Doe",
    "payload": { "config": { "threshold": 650 } },
    "createdAt": "2026-03-15T10:00:00.000Z"
  }
]

POST /api/v1/approvals

Create a new approval request.

Request Body

FieldTypeRequiredDescription
entityTypestringYesEntity type (e.g., "qualificationRule", "contactPolicy", "decisionFlow", "offer")
entityIdstringYesID of the entity to modify
entityNamestringYesDisplay name of the entity
actionstringYes"create", "update", or "delete"
payloadobjectNoThe proposed changes to apply on approval

Example

curl -X POST https://playground.kaireonai.com/api/v1/approvals \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{
    "entityType": "qualificationRule",
    "entityId": "qr_001",
    "entityName": "Credit Score Rule",
    "action": "update",
    "payload": { "config": { "threshold": 650 } }
  }'
Response: 201 Created

GET /api/v1/approvals/

Get a single approval request.

POST /api/v1/approvals/

Resolve an approval request (approve or reject). Admin only. When approved, the stored payload is automatically applied to the target entity. Supported entity types for auto-application: algorithmModel, qualificationRule, contactPolicy, decisionFlow, offer, creative, channel, arbitrationProfile.

Request Body

FieldTypeRequiredDescription
actionstringYes"approve" or "reject"
commentsstringNoReviewer comments

Response (approved)

{
  "id": "approval_001",
  "status": "approved",
  "approverId": "user_002",
  "approverName": "Admin",
  "comments": "Looks good, deploying to production",
  "resolvedAt": "2026-03-16T14:30:00.000Z"
}

Response (rejected)

{
  "id": "approval_001",
  "status": "rejected",
  "approverId": "user_002",
  "approverName": "Admin",
  "comments": "Threshold too aggressive, please revise",
  "resolvedAt": "2026-03-16T14:30:00.000Z"
}

Roles

EndpointAllowed Roles
GET /approvalsany authenticated
POST /approvalsany authenticated
GET /approvals/{id}any authenticated
POST /approvals/{id} (resolve)admin
See also: Compliance