---
title: "Assign User Group Members"
method: POST
path: "/api/v2/core/user-groups/{userGroupId}/users"
tags: ["User Groups"]
---

# Assign User Group Members

`POST /api/v2/core/user-groups/{userGroupId}/users`

## Request

- Base URL: `https://apiv2.eightfold.ai`
- URL: `https://apiv2.eightfold.ai/api/v2/core/user-groups/{userGroupId}/users`
- Auth: none declared. Required headers: `Authorization`
- TypeScript: <https://skmtc.dev/eightfold/apis/api-server-v2-service-service/docs/api/v2/core/user-groups/:userGroupId/users/post.ts> (a function with typed inputs; its response is checked against the schema)

Assigns users to a user group. Additive: users already in the group are reported back in existingUsers and left untouched, so the call is safe to retry. Every id is validated before any is written, so one bad id rejects the whole request. Candidate and deleted accounts cannot be assigned, and system user groups are refused because their membership is derived from roles.

## Path parameters

- `userGroupId` string, required

## Headers

- `Authorization` string, required

## Request body

- UserGroupAssignMembersSchema
  - `userIds` integer[], required: Ids of the users to assign, at most 100 per request. Every id is validated before any is written, so one bad id rejects the whole request

## Response `200`

OK

- UserGroupMembershipResultSchema
  - `createdAt` integer, nullable: Create timestamp of the user group
  - `id` integer, nullable: Id of the user group
  - `isActive` boolean, nullable: Whether the user group is active
  - `addedUsers` UserGroupMemberSchema[], nullable: Users assigned to the group by this request
    - `uuid` string, nullable: External unique identifier of the user
    - `userId` integer, nullable: Id of the user
    - `membershipType` string, nullable: static for an explicitly assigned member, dynamic for one matched by the group rules. Only static members can be removed
    - `firstName` string, nullable: First name of the user
    - `lastName` string, nullable: Last name of the user
    - `email` string, nullable: Email of the user
  - `description` string, nullable: Description of the user group
  - `productLine` string, nullable: Product line this user group applies to. Defaults to all product lines
  - `updatedAt` integer, nullable: Update timestamp of the user group
  - `role` string, nullable: Role granted to the members of the user group
  - `userGroupName` string, nullable: Name of the user group
  - `existingUsers` UserGroupMemberSchema[], nullable: Users from the request that were already members, left untouched
    - `uuid` string, nullable: External unique identifier of the user
    - `userId` integer, nullable: Id of the user
    - `membershipType` string, nullable: static for an explicitly assigned member, dynamic for one matched by the group rules. Only static members can be removed
    - `firstName` string, nullable: First name of the user
    - `lastName` string, nullable: Last name of the user
    - `email` string, nullable: Email of the user

## Changes

- **2026-11-03** `9a8b3a927e93`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/eightfold/apis/api-server-v2-service-service/changes/api/v2/core/user-groups/:userGroupId/users/post.md)

---

[API](https://skmtc.dev/eightfold/apis/api-server-v2-service-service.md) - [All operations](https://skmtc.dev/eightfold/apis/api-server-v2-service-service/llms.txt) - [OpenAPI document](https://skmtc.dev/eightfold/apis/api-server-v2-service-service/revisions/9a8b3a927e93?raw)
