Skip to main content
Sessions represent active connections between users and your application. Each session tracks connection state, token expiry, and activity timestamps.

Endpoints

MethodPathPurpose
GET/applications/:applicationId/sessionsList sessions
GET/applications/:applicationId/sessions/:sessionIdGet session
DELETE/applications/:applicationId/sessionsRevoke all sessions
applicationId and sessionId path params are UUIDs.

List sessions

curl "https://api.kontext.dev/api/v1/applications/550e8400-e29b-41d4-a716-446655440000/sessions?limit=50" \
  -H "Authorization: Bearer $TOKEN"
Returns a list of sessions for the application.

Query parameters

ParameterTypeDefaultDescription
limitnumber100Maximum sessions to return
statusstringFilter by status: "active", "inactive", or "all"
includeInactivebooleanfalseInclude disconnected/expired sessions

Get session

curl https://api.kontext.dev/api/v1/applications/550e8400-e29b-41d4-a716-446655440000/sessions/44444444-4444-4444-8444-444444444444 \
  -H "Authorization: Bearer $TOKEN"

Session object

Response shape: { "session": { ... } }
FieldTypeDescription
idstringSession UUID
namestringHuman-readable session name
statusstringSession status: "active" or "disconnected"
derivedStatusstringComputed status (see below)
tokenExpiresAtstring?ISO 8601 timestamp when the session token expires
lastActiveAtstring?ISO 8601 timestamp of last activity
connectedAtstring?ISO 8601 timestamp when the session was established
disconnectedAtstring?ISO 8601 timestamp when disconnected
createdAtstringISO 8601 timestamp
agentIdstringApplication ID that created this session
organizationIdstringOwning organization ID
hostnamestring | nullHostname reported by the MCP client
userAgentstring | nullUser agent reported by the MCP client
clientInfoobject | nullMCP client metadata

Derived status values

StatusMeaning
activeConnected and has been active recently
idleConnected but no recent activity
expiredToken has expired
disconnectedTransport connection is closed

Revoke all sessions

curl -X DELETE https://api.kontext.dev/api/v1/applications/550e8400-e29b-41d4-a716-446655440000/sessions \
  -H "Authorization: Bearer $TOKEN"
Terminates all active sessions for the application. Connected clients receive a disconnect event and need to re-authenticate.

Response

FieldTypeDescription
successbooleanAlways true on success
disconnectedCountnumberNumber of sessions that were terminated