Replace the retrieval sources selected for a chat
Overwrites the chat's entire selection set with the sources in the body and returns what was stored; an empty list means retrieval falls back to the whole workspace. Requires a workspace member with the `ai:write` permission, and an unknown chat is reported as not found. Naturally idempotent: sending the same set again leaves the selection unchanged.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PUT "https://example.com/v1/workspaces/string/rag/chats/string/sources" \ -H "Content-Type: application/json" \ -d '{ "sources": [ { "sourceKind": "page", "sourceId": "string" } ] }'{ "data": [ { "sourceKind": "page", "sourceId": "string" } ]}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}List the retrieval sources a chat can draw on
Returns every indexed source in the workspace with its label and chunk count, each flagged with whether this chat currently has it selected. Requires a workspace member with the `ai:read` permission; a chat that does not exist in this workspace is reported as not found.
Run a cited semantic search over a chat's sources
Embeds the query and returns the closest chunks with similarity scores and stable, human-readable citations, restricted to the chat's selected sources (or the whole workspace when none are selected) and filtered again by the caller's per-source access. Requires a workspace member with the `ai:read` permission and a plan that includes the `semantic_search` feature; a workspace without it is refused as entitlement-locked. Pass `limit` to cap the number of results.