Skip to main content

aiAssignmentsAssign

AiAssignmentMutationResult aiAssignmentsAssign(AiAssignmentsAssignRequest)

PUT /api/2.0/ai/assignments/assign

Bind a profile to an action

Binds a profile to one AI action portal-wide, creating the assignment or replacing it in place, and returns the result. Both actionType and profileId are required. The profile's declared capabilities are checked against the action, so a model that cannot generate images cannot be bound to ImageGeneration - the Default slot is exempt, because it stands in for every action. There is no room-scoped form of this write: a room's own binding is created by the agent that owns it, while reads accept an entityId.

Parameters​

NameInTypeDescriptionNotes
AiAssignmentsAssignRequestbodyAiAssignmentsAssignRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the binding was stored. A failure is reported in error rather than as a status.AiAssignmentMutationResult-
400actionType or profileId 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​

AiAssignmentMutationResult

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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