跳到主要内容

aiPromptsUpdate

AiPromptMutationResult aiPromptsUpdate(AiPromptsUpdateRequest)

PUT /api/2.0/ai/prompts/update

Update a saved prompt

Changes a saved prompt and returns the stored result. Only the fields present in updates are written, so a partial object leaves the rest of the prompt alone. The name and the folder reference are re-validated whenever either changes, which means an update can fail on a name another prompt in the same folder already uses - that answers 409, an unknown prompt or folder 404, an empty or non-string value 400, always with the { success: false, error } body. Use PUT api/2.0/ai/prompts/move to change only the folder.

Parameters​

NameInTypeDescriptionNotes
AiPromptsUpdateRequestbodyAiPromptsUpdateRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the prompt was updated, with the stored prompt in prompt.AiPromptMutationResult-
400id is missing, updates is not an object, or a field in it has the wrong type or is empty.AiPromptMutationResult-
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-
404No prompt has this ID, or folderId names no folder of the caller's.AiPromptMutationResult-
409A prompt of that name already sits in the target folder.AiPromptMutationResult-
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​

AiPromptMutationResult

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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