SAI Chats
Conversations between your customers and SAI (SiPhox AI). Send messages and create conversations through POST /api/v1/sai/chats/{userId}, and list, tag, annotate, or delete conversations. The older separate create-chat and send-message endpoints are deprecated in favor of this consolidated endpoint.
Create a conversation
Deprecated — use `POST /api/v1/sai/chats/{userId}` instead. Creates a conversation for a user and returns the AI's reply to `initialMessage` along with the new `chatId`. The customer must belong to your business, and each call counts toward your subscription's metered SAI usage.
List conversations
Returns conversations with message counts, first and last messages, and your business's `tags` and `notes` metadata. Filter by `userId`. Results are paginated via `page` (default `1`) and `limit` (default `50`); the response includes a `pagination` object whose `total` reflects your business's conversations matching the filters (including `tags`).
Send a message to a conversation
Deprecated — use `POST /api/v1/sai/chats/{userId}` instead. Sends a `message` to an existing conversation and returns the AI's reply. The conversation must belong to your business.
Update a conversation's tags and notes
Updates conversation metadata and returns the resulting `tags` and `notes`. `tags` replaces the conversation's entire tag list; `notes` appends one timestamped note. The conversation must belong to your business.
Delete a conversation
Deletes a conversation and its metadata. Deleted conversations no longer appear in `GET /api/v1/sai/chats` and can no longer be continued. The conversation must belong to your business.
Send a chat message
Creates a new conversation or continues an existing one, and returns the AI's reply along with the `chatId`. Omit `chatId` to start a conversation (optionally with `customInstructions`); include `chatId` to continue that conversation (`customInstructions` is then ignored). `saiResponse` is a JSON-encoded string of content sections — `PARAGRAPH` text and `RESULTS_READ_OUT` biomarker results — plus optional `productInfo`, `getSupport`, and `followUpQuestions` fields. The customer (`userId` is the customer ID returned by the Customers endpoints) must belong to your business, and each call counts toward your subscription's metered SAI usage; list and manage conversations with `GET /api/v1/sai/chats`.