Tenant Session Store
API Contract
REST
/api/v1/tenant-sessions
5 endpoints
GET
/api/v1/tenant-sessions/api/v1/tenant-sessions
List active tenant sessions for the current user
Public
Response Example
{
"data": [
{
"session_id": "ses_01J4K8M2N3P5Q7S1",
"user_id": "usr_01J4K8M2N3P5Q7A1",
"org_id": "org_01J4K8M2N3P5Q7R9",
"org_name": "Northbrook Academy",
"is_active": true,
"created_at": "2026-03-26T09:00:00Z",
"expires_at": "2026-03-27T09:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/tenant-sessions/api/v1/tenant-sessions/:id
Get a specific tenant session with full context payload
Public
Response Example
{
"session_id": "ses_01J4K8M2N3P5Q7S1",
"user_id": "usr_01J4K8M2N3P5Q7A1",
"org_id": "org_01J4K8M2N3P5Q7R9",
"org_name": "Northbrook Academy",
"tenant_context": {
"org_id": "org_01J4K8M2N3P5Q7R9",
"role": "admin",
"terminology": {
"student": "Learner",
"class": "Cohort"
},
"feature_flags": {
"peer_review_beta": true,
"analytics_dashboard": false
}
},
"is_active": true,
"created_at": "2026-03-26T09:00:00Z",
"expires_at": "2026-03-27T09:00:00Z"
}
POST
/api/v1/tenant-sessions/api/v1/tenant-sessions
Create and persist a new tenant session for the selected org
Public
Request Example
{
"org_id": "org_01J4K8M2N3P5Q7R9",
"tenant_context": {
"org_id": "org_01J4K8M2N3P5Q7R9",
"role": "admin",
"terminology": {
"student": "Learner"
},
"feature_flags": {
"peer_review_beta": true
}
}
}
Response Example
{
"session_id": "ses_01J9X3P7K2M4N6G6",
"user_id": "usr_01J4K8M2N3P5Q7A1",
"org_id": "org_01J4K8M2N3P5Q7R9",
"org_name": "Northbrook Academy",
"is_active": true,
"created_at": "2026-03-26T12:00:00Z",
"expires_at": "2026-03-27T12:00:00Z"
}
PUT
/api/v1/tenant-sessions/api/v1/tenant-sessions/:id
Refresh or update the tenant context within an existing session
Public
Request Example
{
"tenant_context": {
"org_id": "org_01J4K8M2N3P5Q7R9",
"role": "admin",
"terminology": {
"student": "Learner",
"class": "Cohort"
},
"feature_flags": {
"peer_review_beta": true,
"ai_feedback_assistant": true
}
}
}
Response Example
{
"session_id": "ses_01J9X3P7K2M4N6G6",
"user_id": "usr_01J4K8M2N3P5Q7A1",
"org_id": "org_01J4K8M2N3P5Q7R9",
"is_active": true,
"updated_at": "2026-03-26T14:00:00Z",
"expires_at": "2026-03-27T14:00:00Z"
}
DELETE
/api/v1/tenant-sessions/api/v1/tenant-sessions/:id
Terminate and clear a specific tenant session
Public
Response Example
{
"success": true,
"cleared_at": "2026-03-26T16:00:00Z"
}