跳到主要内容

aiThreadsDelete

AiSuccessResponse aiThreadsDelete(AiThreadsDeleteRequest)

DELETE /api/2.0/ai/threads/delete

Delete a chat thread

Deletes a thread together with every message in it. The thread has to exist: unlike the other operations that take a threadId, this one checks first and answers 404 for an unknown or already-deleted thread rather than reporting success. The deletion is permanent and the messages cannot be recovered. To empty a thread but keep it, use DELETE api/2.0/ai/threads/clear-messages.

Parameters​

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

Responses​

Status codeDescriptionTypeResponse headers
200Confirms the thread and its messages are gone.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-
404No thread has this ID.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