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.
| Method | Path | Used for |
|---|---|---|
GET | /auth/session | Validate the token, get the user |
POST | /auth/logout | Sign out |
GET | /threads | Conversation list |
GET / PATCH / DELETE | /threads/{id} | Load, rename, delete |
GET | /threads/{id}/evidence | Product evidence for an answer |
POST | /threads/{id}/present | Product presentation for an answer |
POST | /threads/{id}/suggest | Follow-up suggestions |
PUT | /threads/{id}/transcript | Save the rendered transcript (restore on reopen) |
POST | /threads/{id}/compare | Compare products |
POST | /threads/{id}/cart/items | Add to cart during a conversation |
GET / DELETE | /account/cart | Cart |
POST | /account/cart/items | Add |
PUT / DELETE | /account/cart/items/{productId} | Set quantity, remove |
GET / POST | /account/wishlist | Wishlist |
DELETE | /account/wishlist/{productId} | Unsave |
GET | /account/profile | Shopper profile and household |
POST | /ocr | Read text from a photo |
WebSocket
wss://<host>/ws. Frames are JSON objects with a type.
Client → server
type | Fields |
|---|---|
new_thread | name |
send | thread_id, text |
interrupt | thread_id, turn_id |
resume_thread | thread_id |
ping |
Server → client
type | Meaning |
|---|---|
ready | The connection is accepted. It includes the protocol version. |
result | Reply to a command (action, result) |
action_error | A command failed (action, message) |
| Turn frames | Streaming 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.