Expiry RLS Policy
API Contract
REST
/api/v1/mentor-listings
5 endpoints
GET
/api/v1/mentor-listings/api/v1/mentor-listings
List mentors as seen through RLS filter. Public callers see only active mentors; coordinators see all including suppressed.
Public
Response Example
{
"data": [
{
"mentor_id": "mentor_sarah_chen",
"display_name": "Sarah Chen",
"is_active_for_public": true,
"is_suppressed": false,
"certification_status": "expiring_soon",
"expiry_date": "2026-04-15T00:00:00Z"
},
{
"mentor_id": "mentor_priya_sharma",
"display_name": "Priya Sharma",
"is_active_for_public": true,
"is_suppressed": false,
"certification_status": "active",
"expiry_date": "2026-09-30T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/mentor-listings/api/v1/mentor-listings/:mentor_id
Get the listing status for a specific mentor, including RLS-evaluated visibility.
Public
Response Example
{
"mentor_id": "mentor_sarah_chen",
"display_name": "Sarah Chen",
"is_active_for_public": true,
"is_suppressed": false,
"suppression_computed_at": "2026-03-26T00:00:00Z",
"certification_status": "expiring_soon",
"expiry_date": "2026-04-15T00:00:00Z"
}
POST
/api/v1/mentor-listings/api/v1/mentor-listings
Create a mentor listing entry (used when a mentor profile is first activated).
Public
Request Example
{
"mentor_id": "mentor_new_001",
"display_name": "Alex Nguyen",
"certification_status": "active",
"expiry_date": "2027-01-31T00:00:00Z"
}
Response Example
{
"mentor_id": "mentor_new_001",
"display_name": "Alex Nguyen",
"is_active_for_public": true,
"is_suppressed": false,
"suppression_computed_at": "2026-03-26T11:00:00Z",
"certification_status": "active",
"expiry_date": "2027-01-31T00:00:00Z"
}
PUT
/api/v1/mentor-listings/api/v1/mentor-listings/:mentor_id
Refresh or update a mentor's listing status (triggers suppression column recompute).
Public
Request Example
{
"certification_status": "active",
"expiry_date": "2027-04-15T00:00:00Z",
"refresh_suppression_column": true
}
Response Example
{
"mentor_id": "mentor_sarah_chen",
"display_name": "Sarah Chen",
"is_active_for_public": true,
"is_suppressed": false,
"suppression_computed_at": "2026-03-26T11:20:00Z",
"certification_status": "active",
"expiry_date": "2027-04-15T00:00:00Z"
}
DELETE
/api/v1/mentor-listings/api/v1/mentor-listings/:mentor_id
Remove a mentor listing entry (e.g., mentor account deactivated).
Public
Response Example
{
"deleted": true,
"mentor_id": "mentor_sarah_chen"
}