REST /api/v1/expiry-orchestration 5 endpoints
GET /api/v1/expiry-orchestration/api/v1/expiry-orchestration

List orchestration run records with outcomes and threshold evaluations.

Public

Response Example

{
  "data": [
    {
      "run_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
      "triggered_by": "expiry-check-edge-function",
      "expirations_evaluated": 12,
      "notifications_dispatched": 3,
      "thresholds_hit": [
        "30_day",
        "7_day",
        "expired"
      ],
      "status": "completed",
      "started_at": "2026-03-26T08:00:00Z",
      "completed_at": "2026-03-26T08:00:12Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1
  }
}
GET /api/v1/expiry-orchestration/api/v1/expiry-orchestration/:run_id

Get the details of a specific orchestration run.

Public

Response Example

{
  "run_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
  "triggered_by": "expiry-check-edge-function",
  "expirations_evaluated": 12,
  "notifications_dispatched": 3,
  "thresholds_hit": [
    "30_day",
    "7_day",
    "expired"
  ],
  "dispatched_notifications": [
    {
      "mentor_id": "mentor_sarah_chen",
      "coordinator_id": "coord_maya_patel",
      "threshold": "30_day"
    },
    {
      "mentor_id": "mentor_james_okafor",
      "coordinator_id": "coord_maya_patel",
      "threshold": "7_day"
    }
  ],
  "status": "completed",
  "started_at": "2026-03-26T08:00:00Z",
  "completed_at": "2026-03-26T08:00:12Z"
}
POST /api/v1/expiry-orchestration/api/v1/expiry-orchestration

Manually trigger an expiry orchestration run over a set of expiry records.

Public

Request Example

{
  "triggered_by": "admin_manual",
  "expirations": [
    {
      "mentor_id": "mentor_sarah_chen",
      "coordinator_id": "coord_maya_patel",
      "expiry_date": "2026-04-15T00:00:00Z"
    }
  ]
}

Response Example

{
  "run_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
  "triggered_by": "admin_manual",
  "expirations_evaluated": 1,
  "notifications_dispatched": 1,
  "thresholds_hit": [
    "30_day"
  ],
  "status": "completed",
  "started_at": "2026-03-26T14:00:00Z",
  "completed_at": "2026-03-26T14:00:03Z"
}
PUT /api/v1/expiry-orchestration/api/v1/expiry-orchestration/:run_id

Update orchestration run metadata (e.g., mark a failed run as resolved).

Public

Request Example

{
  "status": "resolved",
  "resolution_notes": "Manually re-processed after transient FCM failure."
}

Response Example

{
  "run_id": "f6a7b8c9-d0e1-2345-fabc-456789012345",
  "triggered_by": "expiry-check-edge-function",
  "expirations_evaluated": 12,
  "notifications_dispatched": 3,
  "status": "resolved",
  "resolution_notes": "Manually re-processed after transient FCM failure.",
  "started_at": "2026-03-26T08:00:00Z",
  "completed_at": "2026-03-26T08:00:12Z"
}
DELETE /api/v1/expiry-orchestration/api/v1/expiry-orchestration/:run_id

Delete an orchestration run record.

Public

Response Example

{
  "deleted": true,
  "run_id": "f6a7b8c9-d0e1-2345-fabc-456789012345"
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}