Skip to main content

aiPromptsImportBundle

AiImportResult aiPromptsImportBundle(AiPromptsImportBundleRequest)

POST /api/2.0/ai/prompts/import-bundle

Import bundle

Writes a bundle produced by GET api/2.0/ai/prompts/export back into the caller's library. mode decides how: replace deletes the current prompts and folders before writing, and merge writes the bundle on top of what is already there. The folder references inside the bundle are validated before anything is written, so a corrupt bundle is rejected whole rather than applied halfway. replace is destructive and cannot be undone - export first if the current library matters.

Parameters​

NameInTypeDescriptionNotes
AiPromptsImportBundleRequestbodyAiPromptsImportBundleRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the bundle was written, how many prompts it imported, and what was refused.AiImportResult-
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​

AiImportResult

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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