GET
/
api
/
messaging
/
sessions
/
{sessionId}
Get session information
curl --request GET \
  --url http://localhost:3000/api/messaging/sessions/{sessionId}
// 404 - Session not found
{
  "error": "Session not found",
  "code": "SESSION_NOT_FOUND",
  "details": {
    "sessionId": "abc-123"
  }
}

// 410 - Session expired
{
  "error": "Session has expired",
  "code": "SESSION_EXPIRED",
  "details": {
    "sessionId": "abc-123",
    "expiresAt": "2024-01-15T10:30:00Z"
  }
}
This endpoint returns comprehensive session information including timeout configuration, renewal count, and real-time expiration status.

Path Parameters

sessionId
string
required
The unique identifier of the session

Response

sessionId
string
Unique session identifier
agentId
string
UUID of the agent
userId
string
UUID of the user
createdAt
string
ISO timestamp of session creation
lastActivity
string
ISO timestamp of last activity in the session
expiresAt
string
ISO timestamp when the session will expire
timeoutConfig
object
Current timeout configuration for the session
renewalCount
number
Number of times the session has been renewed
timeRemaining
number
Milliseconds until session expiration
isNearExpiration
boolean
Whether the session is within the warning threshold
metadata
object
Any metadata attached to the session

Error Responses

// 404 - Session not found
{
  "error": "Session not found",
  "code": "SESSION_NOT_FOUND",
  "details": {
    "sessionId": "abc-123"
  }
}

// 410 - Session expired
{
  "error": "Session has expired",
  "code": "SESSION_EXPIRED",
  "details": {
    "sessionId": "abc-123",
    "expiresAt": "2024-01-15T10:30:00Z"
  }
}

Path Parameters

sessionId
string
required

ID of the session

Response

Session information retrieved successfully

sessionId
string
agentId
string<uuid>
userId
string<uuid>
createdAt
string<date-time>
lastActivity
string<date-time>
metadata
object
expiresAt
string<date-time>

When the session will expire

timeoutConfig
object

Current timeout configuration

renewalCount
integer

Number of times the session has been renewed

timeRemaining
integer

Milliseconds until session expiration

isNearExpiration
boolean

Whether the session is within the warning threshold