API REFERENCE
List Session Chats
On this page
/api/sessions/{sessionId}/chatsLists every chat in the given session as a ChatSummary (chat row plus per-account hasUnread and isStreaming flags), along with the caller's default model id. Chats are sorted by createdAt ascending.
Authentication
x-api-key in header
BearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/sessions/YOUR_SESSION_ID/chats' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
sessionIdstringrequiredThe id of the parent session.
Responses
200Chats retrieved successfully.+
application/json
chatsarray<ChatSummary>requiredEvery chat in the session, sorted by createdAt ascending.
Item properties for chats
idstringrequiredsessionIdstringrequiredtitlestringrequiredmodelIdstringnullableactiveStreamIdstringnullablelastAssistantMessageAtstringnullableformat: date-time
createdAtstringrequiredformat: date-time
updatedAtstringrequiredformat: date-time
hasUnreadbooleanrequiredTrue when lastAssistantMessageAt is newer than the caller's chat_reads.last_read_at (or no read row exists yet).
isStreamingbooleanrequiredTrue when activeStreamId is non-null.
defaultModelIdstringrequiredDefault model id surfaced to clients with no explicit preference (e.g. openai/gpt-5.4).
401Unauthorized — invalid or missing API key / Bearer token.+
application/json
statusstring · enumrequiredAlways "error" for error responses.
Values: "error"
errorstringrequiredHuman-readable error message.
403Forbidden — the authenticated account does not own this session.+
application/json
statusstring · enumrequiredAlways "error" for error responses.
Values: "error"
errorstringrequiredHuman-readable error message.
404Not found — no session exists with the given id.+
application/json
statusstring · enumrequiredAlways "error" for error responses.
Values: "error"
errorstringrequiredHuman-readable error message.
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download sessions.jsonView operation source
{
"summary": "List session chats",
"description": "Lists every chat in the given session as a `ChatSummary` (chat row plus per-account `hasUnread` and `isStreaming` flags), along with the caller's default model id. Chats are sorted by `createdAt` ascending.",
"parameters": [
{
"name": "sessionId",
"in": "path",
"required": true,
"description": "The id of the parent session.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Chats retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListSessionChatsResponse"
}
}
}
},
"401": {
"description": "Unauthorized — invalid or missing API key / Bearer token.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Forbidden — the authenticated account does not own this session.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found — no session exists with the given id.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}