Skip to main content

aiAgentsCreate

AiFolderWrapper aiAgentsCreate(AiAgentsCreateRequest)

POST /api/2.0/ai/agents

Create an agent

Creates an AI agent room and binds a model to it, in that order. profileId is required, has to be a UUID, has to name an existing profile, and that profile has to support chat - an image-only model is refused here rather than failing on every later request. prompt is required and is stored on the room as its standing instruction with any markup stripped, so it cannot round-trip HTML into another user's reply. The two steps are not atomic: when the room is created but the model binding fails, the call reports an error and the room is left behind, so re-bind it with PUT api/2.0/ai/agents/{id} rather than creating a second one.

Parameters​

NameInTypeDescriptionNotes
AiAgentsCreateRequestbodyAiAgentsCreateRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200The created agent room, with the model already bound to it.AiFolderWrapper-
400profileId is missing, is not a UUID, names no existing profile, or names one that does not support chat; or prompt 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​

AiFolderWrapper

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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