> For the complete documentation index, see [llms.txt](https://fusionauth.io/docs/llms.txt)

# Group | FusionAuth Docs

Learn about the APIs for provisioning SCIM Groups in FusionAuth using a SCIM Client.

# Group

[Edit on GitHub](https://github.com/FusionAuth/fusionauth-site/blob/main/astro/src/content/docs/apis/scim/scim-group.mdx)

[View Markdown](https://fusionauth.io/docs/apis/scim/scim-group.md)

This feature is only available in the Enterprise plan. To learn more, see [our pricing page](https://fusionauth.io/pricing.md).

This page contains all of the APIs for managing Groups through [SCIM Group](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2) requests.

## Create a Group

This API is intended to be called by a SCIM Client and is used to create a new FusionAuth Group.

### Request

[!Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials)

Create a Group

POST/api/scim/resource/v2/Groups

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group request body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-request-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-request-converter.md#default-lambda) is provided to handle a typical request that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

#### Example Request Body

*Example Request JSON*

```json
{
  "externalId": "2819c223-7f76-453a-919d-413861904646",
  "displayName": "Sales Reps",
  "members": [
    {
      "displayName": "John Doe",
      "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
      "value": "902c246b-6245-4190-8e05-00816be7344a"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

### Response

The response for this API contains the Group that was just created in SCIM schema format.

Response Codes

| Code | Description |
| --- | --- |
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain a [SCIM Error](https://fusionauth.io/docs/apis/scim.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid JWT in your Authorization header. The response will be empty. Ensure you've correctly set up Entities and performed a [Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials) grant. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
| 503 | The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body. |
| 504 | One or more Webhook endpoints returned an invalid response or were unreachable. Based on the transaction configuration for this event your action cannot be completed. A stack trace is provided and logged in the FusionAuth log files. |

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. See more details in the [SCIM API Overview](https://fusionauth.io/docs/apis/scim.md).

#### Example Response Body

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group response body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md#default-lambda) is provided to handle a typical response that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

*Example Response JSON*

```json
{
  "id": "2819c223-7f76-453a-919d-413861904600",
  "externalId": "2819c223-7f76-453a-919d-413861904646",
  "displayName": "Sales Reps",
  "members": [
    {
      "displayName": "John Doe",
      "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
      "value": "902c246b-6245-4190-8e05-00816be7344a"
    }
  ],
  "meta": {
    "created": "2022-01-23T04:56:22Z",
    "lastModified": "2022-03-13T04:42:34Z",
    "location": "https://login.piedpiper.com/api/scim/v2/Groups/2819c223-7f76-453a-919d-413861904600",
    "resourceType": "Group"
  },
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

## Retrieve a Group

This API is used to retrieve a FusionAuth Group in SCIM schema format through a SCIM request.

### Request

[!Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials)

Retrieves a Group

GET/api/scim/resource/v2/Groups/{groupId}

#### Request Parameters

`groupId`UUIDoptional

The FusionAuth unique Group Id.

### Response

The response for this API contains the Group in SCIM schema format.

Response Codes

| Code | Description |
| --- | --- |
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain a [SCIM Error](https://fusionauth.io/docs/apis/scim.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid JWT in your Authorization header. The response will be empty. Ensure you've correctly set up Entities and performed a [Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials) grant. |
| 404 | The object doesn't exist. The response will be empty. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
| 503 | The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body. |
| 504 | One or more Webhook endpoints returned an invalid response or were unreachable. Based on the transaction configuration for this event your action cannot be completed. A stack trace is provided and logged in the FusionAuth log files. |

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. See more details in the [SCIM API Overview](https://fusionauth.io/docs/apis/scim.md).

#### Example Response Body

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group response body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md#default-lambda) is provided to handle a typical response that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

*Example Response JSON*

```json
{
  "id": "2819c223-7f76-453a-919d-413861904600",
  "externalId": "2819c223-7f76-453a-919d-413861904646",
  "displayName": "Sales Reps",
  "members": [
    {
      "displayName": "John Doe",
      "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
      "value": "902c246b-6245-4190-8e05-00816be7344a"
    }
  ],
  "meta": {
    "created": "2022-01-23T04:56:22Z",
    "lastModified": "2022-03-13T04:42:34Z",
    "location": "https://login.piedpiper.com/api/scim/v2/Groups/2819c223-7f76-453a-919d-413861904600",
    "resourceType": "Group"
  },
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

## Retrieve Groups

This API is used to retrieve a paginated set of Groups with an optional filter.

### Request

[!Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials)

Retrieve Groups

GET/api/scim/resource/v2/Groups

#### Request Parameters

`count`Integeroptional

The number of results to return. Used for pagination.

`excludedAttributes`StringoptionalAvailable since 1.39.0

A comma separated list of one or more attributes to exclude in the JSON response body.

For example, a value of `members` will remove the **members** attribute from all Groups returned in the response.

`filter`StringoptionalAvailable since 1.39.0

The SCIM filter string used to limit the Groups returned to those matching the criteria.

The use of this parameter is limited when using to filter Groups. The following limitations apply:

*   The **externalId** attribute may be used for an equals comparison
*   The **displayName** attribute may be used with the following operators:
    *   `eq` case-insensitive equals
    *   `co` case-insensitive contains
    *   `sw` case-insensitive starts with
    *   `ew` case-insensitive ends with

`startIndex`Integeroptional

The offset into the total results. In order to paginate the results, increment this value by the **count** for subsequent requests.

This parameter begins at `1`.

### Response

The response for this API contains the Groups in SCIM schema format.

Response Codes

| Code | Description |
| --- | --- |
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain a [SCIM Error](https://fusionauth.io/docs/apis/scim.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid JWT in your Authorization header. The response will be empty. Ensure you've correctly set up Entities and performed a [Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials) grant. |
| 404 | The object doesn't exist. The response will be empty. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
| 503 | The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body. |
| 504 | One or more Webhook endpoints returned an invalid response or were unreachable. Based on the transaction configuration for this event your action cannot be completed. A stack trace is provided and logged in the FusionAuth log files. |

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. See more details in the [SCIM API Overview](https://fusionauth.io/docs/apis/scim.md).

#### Example Response Body

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group response body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md#default-lambda) is provided to handle a typical response that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

*Example Response JSON*

```json
{
  "totalResults": 1,
  "itemsPerPage": 25,
  "startIndex": 1,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "Resources": [
    {
      "id": "2819c223-7f76-453a-919d-413861904600",
      "externalId": "2819c223-7f76-453a-919d-413861904646",
      "displayName": "Sales Reps",
      "members": [
        {
          "displayName": "John Doe",
          "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
          "value": "902c246b-6245-4190-8e05-00816be7344a"
        }
      ],
      "meta": {
        "created": "2022-01-23T04:56:22Z",
        "lastModified": "2022-03-13T04:42:34Z",
        "location": "https://login.piedpiper.com/api/scim/v2/Groups/2819c223-7f76-453a-919d-413861904600",
        "resourceType": "Group"
      },
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
      ]
    }
  ]
}
```

## Update a Group

This API is used to update a new FusionAuth Group from a SCIM request. The FusionAuth Group will be overwritten with only the data contained in the request. It is not a partial update or patch.

### Request

[!Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials)

Updates a Group from a SCIM request

PUT/api/scim/resource/v2/Groups/{groupId}

#### Request Parameters

`groupId`UUIDoptional

The FusionAuth Group Id.

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group request body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-request-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-request-converter.md#default-lambda) is provided to handle a typical request that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

#### Example Request Body

*Example Request JSON*

```json
{
  "externalId": "2819c223-7f76-453a-919d-413861904646",
  "displayName": "Sales Reps",
  "members": [
    {
      "displayName": "John Doe",
      "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
      "value": "902c246b-6245-4190-8e05-00816be7344a"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

### Response

The response for this API contains the Group that was updated in SCIM schema format.

Response Codes

| Code | Description |
| --- | --- |
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The request was invalid and/or malformed. The response will contain a [SCIM Error](https://fusionauth.io/docs/apis/scim.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid JWT in your Authorization header. The response will be empty. Ensure you've correctly set up Entities and performed a [Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials) grant. |
| 404 | The object doesn't exist. The response will be empty. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
| 503 | The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body. |
| 504 | One or more Webhook endpoints returned an invalid response or were unreachable. Based on the transaction configuration for this event your action cannot be completed. A stack trace is provided and logged in the FusionAuth log files. |

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. See more details in the [SCIM API Overview](https://fusionauth.io/docs/apis/scim.md).

#### Example Response Body

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM Group response body. However, your incoming request [lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md) must map these values the FusionAuth Group. A [default lambda](https://fusionauth.io/docs/extend/code/lambdas/scim-group-response-converter.md#default-lambda) is provided to handle a typical response that you may modify if necessary.

This example is taken from [RFC 7643 Section 4.2](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

*Example Response JSON*

```json
{
  "id": "2819c223-7f76-453a-919d-413861904600",
  "externalId": "2819c223-7f76-453a-919d-413861904646",
  "displayName": "Sales Reps",
  "members": [
    {
      "displayName": "John Doe",
      "$ref": "https://login.piedpiper.com/api/scim/v2/Users/902c246b-6245-4190-8e05-00816be7344a",
      "value": "902c246b-6245-4190-8e05-00816be7344a"
    }
  ],
  "meta": {
    "created": "2022-01-23T04:56:22Z",
    "lastModified": "2022-03-13T04:42:34Z",
    "location": "https://login.piedpiper.com/api/scim/v2/Groups/2819c223-7f76-453a-919d-413861904600",
    "resourceType": "Group"
  },
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

## Delete a Group

This API is used to hard delete a FusionAuth Group. You must specify the Id of the Group on the URI.

The data of a Group who has been hard deleted is permanently removed from FusionAuth. The Group's data cannot be restored via the FusionAuth API or the administrative Group interface. If you need to restore the Group's data, you must retrieve it from a database backup.

### Request

[!Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials)

Delete a Group

DELETE/api/scim/resource/v2/Groups/{groupId}

#### Request Parameters

`groupId`UUID

The FusionAuth unique Group Id.

### Response

This API does not return a JSON response body.

The DELETE endpoint will return a `204` status code upon success or one of the standard error status codes.

Response Codes

| Code | Description |
| --- | --- |
| 204 | The request was successful. The response will be empty. |
| 400 | The request was invalid and/or malformed. The response will contain a [SCIM Error](https://fusionauth.io/docs/apis/scim.md) JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present. |
| 401 | You did not supply a valid JWT in your Authorization header. The response will be empty. Ensure you've correctly set up Entities and performed a [Client Credentials](https://fusionauth.io/docs/apis/authentication.md#client-credentials) grant. |
| 404 | The object doesn't exist. The response will be empty. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
| 503 | The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body. |
| 504 | One or more Webhook endpoints returned an invalid response or were unreachable. Based on the transaction configuration for this event your action cannot be completed. A stack trace is provided and logged in the FusionAuth log files. |

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. See more details in the [SCIM API Overview](https://fusionauth.io/docs/apis/scim.md).