跳到主要内容

aiPromptsRenameFolder

AiFolderMutationResult aiPromptsRenameFolder(AiPromptsRenameFolderRequest)

PUT /api/2.0/ai/prompts/rename-folder

Rename folder

Renames a folder in the caller's prompt library, validating the new name against the folders already there. The prompts inside it are untouched and keep their IDs. The answer carries the renamed folder. A name that another folder already uses is rejected with 409, an unknown folder with 404 and a non-string or empty name with 400, always with the { success: false, error } body.

Parameters​

NameInTypeDescriptionNotes
AiPromptsRenameFolderRequestbodyAiPromptsRenameFolderRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the folder was renamed, with the stored folder in folder.AiFolderMutationResult-
400id or name is missing, or name is empty or not a string.AiFolderMutationResult-
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 folder has this ID.AiFolderMutationResult-
409A folder of that name already exists.AiFolderMutationResult-
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​

AiFolderMutationResult

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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