Send a stateless playground turn to the configured AI bot
POST/api/ai/playground/chat
Runs the real chat pipeline (AiManager → VectorSearchService → ChatExecutor) on the supplied transcript and returns the bot's reply plus debug metadata. Admin only.
Stateless: no Conversation / Message / Contact rows are created. The
full transcript must be re-posted on every call so the bot sees the
history. Token costs still land in ai_usage so quotas and per-
credential metrics stay accurate. The fallback chain is honoured: a
transient primary failure rescues onto the secondary credential and
fallback_used reports which credential answered.
The response surfaces the knowledge sources whose chunks fed RAG context for this answer — TITLE + id only, never chunk text or embeddings.
Request
Responses
- 200
- 401
- 403
- 409
- 422
- 502
The bot reply plus debug metadata.
Not authenticated. code: account_disabled means the member's seat was deactivated in this workspace: the session is over even though the token was not revoked (clients sign out and clean up).
Authenticated but not allowed.
AI is disabled, or no chat credential is configured. The error code
is one of ai_disabled, no_chat_credential.
The request failed validation.
Both the primary AND fallback chat providers failed for this
request. The response carries the executor's last classified
error_kind so the UI can surface it.