Skip to main content

aiThreadsList

List aiThreadsList(entityId, count, cursor, query)

GET /api/2.0/ai/threads/list

List chat threads

Lists the threads of a scope, most recently edited first, and searches their titles case-insensitively when query is given. Every parameter is optional: omitting entityId lists the global scope, and omitting count lets the engine apply its own page size. Pagination is by cursor, and the cursor is a JSON object passed as a string in the query - {id: <last thread id>, lastEditDate: <its date>} - taken from the last entry of the previous page. A cursor that is not valid JSON, or that lacks an id, is ignored rather than rejected, and the read silently starts from the first page again.

Parameters​

NameInTypeDescriptionNotes
entityIdqueryStringThe DocSpace entity the request is scoped to - the room, folder or agent workspace the chat is invoked from. Omit for the portal-wide scope.[optional] [example: 1234]
countqueryIntegerThe maximum number of items to return in one page.[optional] [example: 20]
cursorqueryStringThe keyset pagination cursor: the JSON-encoded sort key of the last item already received. Omit for the first page.[optional] [example: {"id":"11111111-1111-1111-1111-111111111111","lastEditDate":1767225600000}]
queryqueryStringThe full-text query the thread list is filtered by.[optional] [example: contract]

Responses​

Status codeDescriptionTypeResponse headers
200The threads of the scope, most recently edited first.List-
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-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

List

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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