RecoupGet a free auditFree audit

API REFERENCE

List Session Chats

On this page
GET/api/sessions/{sessionId}/chats

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.

Authentication

x-api-key in header

BearerAuth bearer

Request

cURL
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.

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request GET \
  --url 'https://recoup-api.vercel.app/api/sessions/{sessionId}/chats'

Parameters

Path parameters

sessionIdstringrequired

The id of the parent session.

Responses

200Chats retrieved successfully.

application/json

chatsarray<ChatSummary>required

Every chat in the session, sorted by createdAt ascending.

Item properties for chats
idstringrequired
sessionIdstringrequired
titlestringrequired
modelIdstringnullable
activeStreamIdstringnullable
lastAssistantMessageAtstringnullable

format: date-time

createdAtstringrequired

format: date-time

updatedAtstringrequired

format: date-time

hasUnreadbooleanrequired

True when lastAssistantMessageAt is newer than the caller's chat_reads.last_read_at (or no read row exists yet).

isStreamingbooleanrequired

True when activeStreamId is non-null.

defaultModelIdstringrequired

Default 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 · enumrequired

Always "error" for error responses.

Values: "error"

errorstringrequired

Human-readable error message.

403Forbidden — the authenticated account does not own this session.

application/json

statusstring · enumrequired

Always "error" for error responses.

Values: "error"

errorstringrequired

Human-readable error message.

404Not found — no session exists with the given id.

application/json

statusstring · enumrequired

Always "error" for error responses.

Values: "error"

errorstringrequired

Human-readable error message.

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download sessions.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}