# Create a group AI agent assignment RBAC: requires GroupAIAgents.Manage Endpoint: POST /api/v1/groups/{groupId}/ai-agents/assignments Version: 1.0 Security: ## Path parameters: - `groupId` (string, required) The unique identifier of the group Example: "us_01hxcvk1hjexere4pvtrj0ymqq" ## Request fields (application/json): - `agentId` (string, required) TypeId of the bot user to assign. Must be a valid user with isBot=true. Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `assignmentType` (string, required) Assignment type determining the bot's operational scope. Valid values: GLOBAL, GROUP, FORUM, FORUM_CATEGORY, GROUP_CHANNEL Enum: "GLOBAL", "GROUP", "FORUM", "FORUM_CATEGORY", "GROUP_CHANNEL" - `resourceId` (string,null) TypeId of the resource to scope the assignment to. Must be null for GLOBAL assignments. Must be null or match the group ID for GROUP assignments. Required for FORUM (forum_id), FORUM_CATEGORY (category_id), GROUP_CHANNEL (channel_id) assignments. The TypeId type must match the assignment type. Example: "us_01hxcvk1hjexere4pvtrj0ymqq" ## Response 200 fields (application/json): - `assignmentId` (string, required) Unique TypeId for this assignment Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `agentId` (string, required) TypeId of the bot user assigned. References a user with isBot=true. Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `assignmentType` (string, required) Assignment type determining where the bot operates. Valid values: GLOBAL, GROUP, FORUM, FORUM_CATEGORY, GROUP_CHANNEL Enum: "GLOBAL", "GROUP", "FORUM", "FORUM_CATEGORY", "GROUP_CHANNEL" - `resourceId` (string,null) TypeId of the specific resource this assignment is scoped to. Null for GLOBAL assignments. Contains forum_id for FORUM, category_id for FORUM_CATEGORY, channel_id for GROUP_CHANNEL assignments. Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `groupId` (string,null) TypeId of the group this assignment belongs to. Present for group-scoped assignments (GROUP, FORUM, FORUM_CATEGORY, GROUP_CHANNEL). Null for GLOBAL assignments. Example: "us_01hxcvk1hjexere4pvtrj0ymqq" - `createdAt` (string, required) ISO 8601 timestamp when this assignment was created Example: "2022-03-10T16:15:50Z" - `updatedAt` (string, required) ISO 8601 timestamp when this assignment was last updated Example: "2022-03-10T16:15:50Z" ## Response 400 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 401 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 403 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation ## Response 404 fields (application/json): - `errorCode` (string, required) Error code - `message` (string, required) Error message - `docUrl` (string) Link to documentation