userId.
Request
Body
| Field | Type | Constraint |
|---|---|---|
name | string | 1–100 chars, trimmed |
headline | string (optional) | ≤ 120 chars |
personality | "professional" | "creative" | "enthusiastic" | |
contextText | string | 1–50,000 chars, trimmed |
suggestedQuestions | string[] | ≤ 6 entries, each ≤ 200 chars |
llmProvider | "anthropic" | "openai" | "google" | "azure" | |
llmModel | string (optional) | ≤ 60 chars; provider-specific model id or Azure deployment |
The LLM API key is not part of this body and must not be sent here. It
lives in the browser’s
localStorage and rides the x-llm-api-key header on
/api/chat/[botId] requests. See BYO-key flow.Behaviour
The route runs in a single Drizzle transaction:- Update the user’s
llm_providerandllm_modelcolumns. - Look up an existing bot for the user.
- If present,
UPDATEit; return200 OK. - Otherwise
INSERT; return201 Created.
Responses
201 Created (first save)
YYYY-MM-DDThh:mm:ss.sssZ.
200 OK (subsequent saves)
Same shape,updatedAt advances.
400 Bad Request - invalid JSON
400 Bad Request - validation failure
401 Unauthorized
cURL
Notes
loadingMessagesis set server-side atINSERTtime from a default JSON literal. It is not part of the request body in Stage 1.isActivedefaults totrueand is not exposed for client updates yet - bot disable/enable is part of Stage 6.- Multi-bot support is planned (Stage 6+).