跳到主要内容

aiAttachmentsSaveFilesMany

List aiAttachmentsSaveFilesMany(AiAttachmentsSaveFilesManyRequest)

POST /api/2.0/ai/attachments/save-files-many

Save files many

Stores several file attachments as drafts in one round trip and returns them in the order they were sent. Each entry is validated exactly as the single-file operation validates its input, and the first bad one rejects the whole batch with its index named in the message - nothing is stored. inputs has to be present and an array: an absent or null value is a malformed request rather than an empty batch, and only an explicit empty array means no files. Follow up with POST api/2.0/ai/attachments/link-to-message to bind the drafts to a message.

Parameters​

NameInTypeDescriptionNotes
AiAttachmentsSaveFilesManyRequestbodyAiAttachmentsSaveFilesManyRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200The stored drafts, in the order they were sent.List-
400inputs is not an array, or one of its entries is malformed.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​

List

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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