Realtime Approval Subscription
API Contract
REST
/api/v1/realtime-subscriptions
6 endpoints
GET
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions
List active realtime subscriptions
Public
Response Example
{
"data": [
{
"channel_id": "chan_b5c6d7e8",
"subscription_type": "organisation_claims",
"organisation_id": "org_001",
"user_id": "usr_coord99",
"status": "connected",
"created_at": "2026-03-26T08:00:00Z",
"last_event_at": "2026-03-26T08:14:22Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 3
}
}
GET
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions/:channel_id
Get subscription channel status and stats
Public
Response Example
{
"channel_id": "chan_b5c6d7e8",
"subscription_type": "organisation_claims",
"organisation_id": "org_001",
"user_id": "usr_coord99",
"status": "connected",
"event_count": 14,
"websocket_url": "wss://realtime.example.com/channels/chan_b5c6d7e8",
"created_at": "2026-03-26T08:00:00Z",
"last_event_at": "2026-03-26T08:14:22Z"
}
POST
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions/organisation
Subscribe to all claim events in an organisation (subscribeToOrganisationClaims)
Public
Request Example
{
"organisation_id": "org_001",
"user_id": "usr_coord99",
"event_types": [
"status_changed",
"claim_submitted",
"claim_approved",
"claim_rejected"
]
}
Response Example
{
"channel_id": "chan_b5c6d7e8",
"subscription_type": "organisation_claims",
"organisation_id": "org_001",
"user_id": "usr_coord99",
"websocket_url": "wss://realtime.example.com/channels/chan_b5c6d7e8",
"status": "connected",
"created_at": "2026-03-26T08:00:00Z"
}
POST
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions/user
Subscribe to a specific user's claim events (subscribeToUserClaims)
Public
Request Example
{
"user_id": "usr_84cd12ef",
"event_types": [
"status_changed",
"comment_added"
]
}
Response Example
{
"channel_id": "chan_f9g0h1i2",
"subscription_type": "user_claims",
"user_id": "usr_84cd12ef",
"websocket_url": "wss://realtime.example.com/channels/chan_f9g0h1i2",
"status": "connected",
"created_at": "2026-03-26T08:00:00Z"
}
PUT
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions/:channel_id/reconnect
Reconnect a dropped channel and receive missed events (reconnect)
Public
Response Example
{
"channel_id": "chan_b5c6d7e8",
"status": "connected",
"reconnected_at": "2026-03-26T09:15:00Z",
"missed_events": 2
}
DELETE
/api/v1/realtime-subscriptions/api/v1/realtime-subscriptions/:channel_id
Unsubscribe and close a realtime channel (unsubscribe)
Public
Response Example
{
"channel_id": "chan_b5c6d7e8",
"unsubscribed": true,
"closed_at": "2026-03-26T10:00:00Z"
}