跳到主要内容

aiAttachmentsLinkToMessage

AiSuccessResponse aiAttachmentsLinkToMessage(AiAttachmentsLinkToMessageRequest)

POST /api/2.0/ai/attachments/link-to-message

Link to message

Binds draft attachments to the chat message that owns them, after that message has been persisted, so that deleting the message removes them too. All three of ids, messageId and threadId are required, and the references are verified rather than trusted: an unknown message answers 404, a message that belongs to a different thread answers 400, and attachments that no longer exist answer 404 naming each missing ID. That verification exists because the underlying binding call skips unknown IDs silently, which used to report success for a link that had not happened. Drafts stay unbound until this succeeds.

Parameters​

NameInTypeDescriptionNotes
AiAttachmentsLinkToMessageRequestbodyAiAttachmentsLinkToMessageRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Confirms the attachments are now bound to the message.AiSuccessResponse-
400The attachment or message reference 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-
404The message or the attachment does not exist.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​

AiSuccessResponse

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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