Skip to main content

aiThreadsCreate

AiThread aiThreadsCreate(AiThreadsCreateRequest)

POST /api/2.0/ai/threads/create

Create a chat thread

Creates a chat thread with a title supplied by the caller and returns it. A scoped thread requires that entityId names a room the caller can open, and a model has to resolve for the scope - an explicit profileId, or the room's Chat assignment - otherwise there is nothing to run the thread against and the call answers 404. In an agent room the agent's own assignment overrides any profileId sent with the request, so a thread there always starts on the agent's model. Use POST api/2.0/ai/threads/open-or-create instead when the title should be generated from the first user message.

Parameters​

NameInTypeDescriptionNotes
AiThreadsCreateRequestbodyAiThreadsCreateRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200The created thread.AiThread-
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 entityId names a room the caller cannot open, or no live AI profile is bound to it, so there is no model to run the thread against.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​

AiThread

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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