Skip to Content
Docs

Store ``chat_prompt_id`` after checking the caller may use that prompt

PUT
/api/user/preferences

Set the prompt the caller's chats use: {success, chat_prompt_id, applied}. With only_if_unset and a chat prompt already stored, nothing is written, applied is false and chat_prompt_id is the stored one as GET reads it. 400 for a value that is neither a preset nor a prompt id, or a non-boolean only_if_unset; 403 for only_if_unset from a token restricted to specific prompts; 404 when the caller can't read the prompt; 500 when the read or write fails. Returns: Response: {success, chat_prompt_id, applied}; applied is false only when only_if_unset found a stored chat prompt, whose readable value chat_prompt_id then carries.

Personal access token scope: prompts:write.

Authorization

bearer
headerAuthorizationBearer <token>

A session token or a personal access token. Leave it empty when the instance runs without authentication (AUTH_TYPE unset).

Request Body

application/json
  1. body
chat_prompt_id*string

The prompt chats use: default, creative, strict, or the id of a prompt the caller can read

only_if_unset?boolean

Store it only when no chat prompt was ever stored (moving a browser's old choice); otherwise the stored one is kept and returned. Refused to a token restricted to specific prompts

Response Body

Success

Example Request
curl -X PUT 'http://localhost:7091/api/user/preferences' \  -H 'Content-Type: application/json' \  -d '{  "chat_prompt_id": "string"}'
Example Response200
Empty