# Generic SCIM Endpoint - Replace Group

The Replace Group endpoint replaces the requested role in its entirety.

### Request

#### Endpoint

`/provisioning/generic/v2/Groups/<ID>`

#### HTTP method

`PUT`

#### Path variables

| Variable | Requirement | Description | Notes                                     | Example   |
| -------- | ----------- | ----------- | ----------------------------------------- | --------- |
| `<ID>`   | Required    | Role ID     | Returns a 404 if the role ID is not found | `r-00001` |

#### Request body attributes

| Attribute     | Requirement | Description                                                                                                                                                                                          | Notes                                                                                                      | Example                                                                  |
| ------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `displayName` | Required    | Display name of the role                                                                                                                                                                             | Returns a 400 if the provided value is empty; returns a 409 if the provided value is already in use        | `"RoleName"`                                                             |
| `members`     | Required    | List of the members of the role with subattributes `value` (user ID) and `display` (human-readable descriptor of the user, for your own use) of the user(s) to be assigned to the role from creation | Returns a 400 if the IDs are formatted incorrectly or are invalid; returns a 404 if user IDs are not found | `[{"value": "a-66f584886171b51d", "display": "userEmail@example.test"}]` |
| `schemas`     | Required    | Schema URI for representing groups                                                                                                                                                                   | Include the value as indicated in the example.                                                             | `["urn:ietf:params:scim:schemas:core:2.0:Group"]`                        |

#### Example request

`PUT app.strongdm.com/provisioning/generic/v2/Groups/r-00001`

```json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
  "displayName": "TestPutBasic",
  "members": []
}
```

### Response

#### Example success response

```http
(Status 204)
```

```json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
  "displayName": "NewRoleName",
  "id": "r-00001",
  "members": [],
  "meta": { "resourceType": "Group", "location": "Groups/r-00001" }
}
```

#### Example response if role ID is not found

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "detail": "Resource r-1230954 not found.",
  "status": "404"
}
```

#### Example response if new role name is empty

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "detail": "could not update role name: cannot update role: invalid operation: name cannot be empty",
  "status": "400"
}
```

#### Example response if user ID is malformed

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "detail": "cannot parse member id: aa-123134",
  "status": "400"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.strongdm.com/references/scim/groups/replace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
