---
title: "Replace Users in a Group"
method: PATCH
path: "/api/v2/groups/{groupId}/relationships/{roleId}"
tags: ["Group"]
---

# Replace Users in a Group

`PATCH /api/v2/groups/{groupId}/relationships/{roleId}`

This endpoint replaces all users in an existing group with the newly supplied users. On a successful add, it returns a `201 Created` response with no body. <h3>Required Scope</h3>`groups:write`

## Path parameters

- `groupId` string, required
- `roleId` string, required

## Request body

- RelationshipsRoleIdBody1
  - `data` Apiv2groupsgroupIdrelationshipsroleIdData[]
    - `type` string — Type of object that will be added as a relationship. Can only be `users`.
    - `id` string, required — The ID of the user that will be added to the group.

## Response `201`

Success

---

[API](https://skmtc.net/degreed/apis/degreed-api-web.md) · [All operations](https://skmtc.net/degreed/apis/degreed-api-web/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/degreed/degreed-api-web/revisions/4a22b709515c/schema)
