Cartesiandocs

Your Cartesian backend

Protocol

The REST endpoints and WebSocket frames the SDK uses. Useful for proxies, firewalls and debugging.

REST

All paths are relative to <baseUrl>/api.

MethodPathUsed for
GET/auth/sessionValidate the token, get the user
POST/auth/logoutSign out
GET/threadsConversation list
GET / PATCH / DELETE/threads/{id}Load, rename, delete
GET/threads/{id}/evidenceProduct evidence for an answer
POST/threads/{id}/presentProduct presentation for an answer
POST/threads/{id}/suggestFollow-up suggestions
PUT/threads/{id}/transcriptSave the rendered transcript (restore on reopen)
POST/threads/{id}/compareCompare products
POST/threads/{id}/cart/itemsAdd to cart during a conversation
GET / DELETE/account/cartCart
POST/account/cart/itemsAdd
PUT / DELETE/account/cart/items/{productId}Set quantity, remove
GET / POST/account/wishlistWishlist
DELETE/account/wishlist/{productId}Unsave
GET/account/profileShopper profile and household
POST/ocrRead text from a photo

WebSocket

wss://<host>/ws. Frames are JSON objects with a type.

Client → server

typeFields
new_threadname
sendthread_id, text
interruptthread_id, turn_id
resume_threadthread_id
ping

Server → client

typeMeaning
readyThe connection is accepted. It includes the protocol version.
resultReply to a command (action, result)
action_errorA command failed (action, message)
Turn framesStreaming activity, agent messages, products, cart and wishlist updates, and capacity. They are reduced into ChatState by the SDK.

The Android and iOS SDKs send X-Cartesian-SDK: android/<version> or ios/<version> on every request and on the socket upgrade, so you can track SDK versions in your logs. The React SDK doesn't send it from browsers, to avoid extra CORS preflight requests.

The recorded sessions in spec/fixtures in the Cartesian repo are the source of truth for turn frames. Every SDK replays them in its tests.