跳到主要内容

aiSettingsSetUser

AiUserSettingsWrapper aiSettingsSetUser(AiSettingsSetUserRequest)

PUT /api/2.0/ai/config/user

Update user AI settings

Replaces the AI settings of the calling user and returns the stored result. chatRecommendedModelVisible is required and has to be a real boolean - a body the JSON parser cannot read, such as one sent as text/plain, used to arrive empty and answer 200 having stored nothing. The body is then proxied to the DocSpace AI service, which validates the rest, so a rejected value comes back with that service's verdict. Only the caller's own settings can be written. Portal-wide configuration is not touched by this operation.

Parameters​

NameInTypeDescriptionNotes
AiSettingsSetUserRequestbodyMapThe user's AI settings: chatRecommendedModelVisible as a boolean, required. Read the current one with GET api/2.0/ai/config/user and send it back changed.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The calling user's stored AI settings.AiUserSettingsWrapper-
400chatRecommendedModelVisible is missing or not a boolean.AiErrorResponse-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API.AiErrorResponse-
413The request body is larger than 100 KB, the JSON parser's limit on this route.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

AiUserSettingsWrapper

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json