Skip to content

Compliance API ​

Endpoints ​

text
GET  /api/v1/compliance/journeys/:journeyId
GET  /api/v1/compliance/users/:userId
GET  /api/v1/compliance/events/:eventId
POST /api/v1/compliance/evaluate
POST /api/v1/compliance/events
GET  /api/v1/admin/compliance/events
GET  /api/v1/admin/compliance/rules
PATCH /api/v1/admin/compliance/rules/:ruleId

Access ​

Restricted.

Journey compliance status:

json
{
  "status": "ALLOW",
  "policyVersion": "PILOT-0.1",
  "evaluatedAt": "2026-09-30T07:20:00Z",
  "checks": [
    { "code": "IDENTITY-001", "status": "PASS" },
    { "code": "VEHICLE-001", "status": "PASS" },
    { "code": "ROUTE-001", "status": "PASS" }
  ]
}

The detailed check list — rule codes, evidence, risk level, internal reason codes — is available only to authorised administrative roles. A consumer client receives the status and an actionable message, not the engine's internal reasoning.

Exposing rule codes to ordinary users would tell a participant exactly which threshold they are being measured against, which invites working around the control rather than complying with it.

Evaluate ​

text
POST /api/v1/compliance/evaluate

Internal service endpoint.

json
{
  "journeyId": "uuid",
  "matchId": "uuid",
  "bookingId": "uuid"
}
json
{
  "decision": "ALLOW",
  "riskLevel": "LOW",
  "policyVersion": "PILOT-0.1",
  "reasonCodes": []
}

Implements evaluate(passenger, driver, vehicle, journey, request, match, policy). Returns a decision — ALLOW, REVIEW or BLOCK — with reasonCodes, riskLevel, policyVersion, ruleResults and evidence.

REVIEW is returned as a successful response, not an error. The evaluation succeeded; the activity was held.

Rules administration ​

text
GET   /api/v1/admin/compliance/rules
PATCH /api/v1/admin/compliance/rules/:ruleId

Requires COMPLIANCE_ADMIN. Every change is audited and creates a new policy version rather than editing the active one in place — otherwise historical decisions stop being explainable.

KHAWI — same route, go together.