跳到主要内容

aiPromptsCreate

AiPromptMutationResult aiPromptsCreate(AiCreatePromptInput)

POST /api/2.0/ai/prompts/create

Save a prompt

Saves a new prompt in the caller's own prompt library and returns it. The name has to be non-empty and unique inside its folder, and folderId has to name an existing folder - omit it to save the prompt at the root. Prompts are per-user: another user's library is never visible here, and no permission beyond having AI enabled is needed. The answer carries the stored prompt including the ID to use with the update, move and delete operations.

Parameters​

NameInTypeDescriptionNotes
AiCreatePromptInputbodyAiCreatePromptInput[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the prompt was saved, with it in prompt.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-
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