Skip to main content

aiThreadsClearMessages

AiSuccessResponse aiThreadsClearMessages(AiThreadsClearMessagesRequest)

DELETE /api/2.0/ai/threads/clear-messages

Clear messages

Removes every message of a thread while keeping the thread, its title and its model binding, and bumps its last-edit date. The messages are gone for good. Unlike delete this does not verify that the thread exists, so clearing an unknown threadId reports success rather than 404. The answer only confirms the write.

Parameters​

NameInTypeDescriptionNotes
AiThreadsClearMessagesRequestbodyStringThe ID of the thread to empty, as a bare JSON string.[required]

Responses​

Status codeDescriptionTypeResponse headers
200Confirms the request was accepted. It does not mean the thread existed.AiSuccessResponse-
400threadId is missing.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​

AiSuccessResponse

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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