# Manage supergroup members

> List supergroups and read/update included and excluded members.

## Overview

A supergroup is a group created dynamically based on shared attributes in Rippling. Instead of including individual people by name, you can make a supergroup based on attributes such as department, location, tenure, employment status, and people who share those attributes will automatically be included in the group.

_Key terms:_

-   **Members**: The effective membership of the group. This includes workers who match the supergroup’s attribute rules plus workers on the inclusion list. This does not include workers on the exclusion list.
-   **Inclusion members**: Workers explicitly added to the group outside of the attribute rules. Adding a worker individually ensures they remain a member even if they don't match any supergroup rules.
-   **Exclusion members**: Workers explicitly excluded from the group. Adding a worker here removes them from members, even when a supergroup rule or inclusion entry would otherwise include them.

### Available endpoints

| Endpoint | Description |
| --- | --- |
| [GET List supergroups](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups) | Lists supergroups. |
| [GET Retrieve a specific supergroup](https://developer.rippling.com/documentation/rest-api/reference/get-supergroups) | Retrieves one supergroup by `id`. |
| [GET List supergroup members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-members) | Lists effective members (including members who match rules and included members). `group_id` maps to `id` from [GET List supergroups](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups). |
| [GET List supergroup inclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-inclusion-members) | Lists explicitly included workers only. |
| [PATCH Update supergroup inclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-inclusion-members) | Adds or removes inclusion members. |
| [GET List supergroup exclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-exclusion-members) | Lists explicitly excluded workers only. |
| [PATCH Update supergroup exclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-exclusion-members) | Adds or removes exclusion members. |

Related endpoints:

| Endpoint | Description |
| --- | --- |
| [GET List workers](https://developer.rippling.com/documentation/rest-api/reference/list-workers) | Lists workers. Use the `id` in `value` when adding or excluding members. |

### Suggested workflow

1.  [List supergroups](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups) and copy the `id` of the group you want to modify.
2.  [List members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-members) to see who is currently in the group. Pass `expand=worker` when you need the worker record.
3.  [List inclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-inclusion-members) or [exclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-exclusion-members) to see members that have been explicitly added or removed.
4.  [List workers](https://developer.rippling.com/documentation/rest-api/reference/list-workers) for the worker IDs that should be added or excluded from the group.
5.  [Update inclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-inclusion-members) or [exclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-exclusion-members) with `add` or `remove`.
6.  List members again to confirm changes.

* * *

## Requirements

-   The Rippling API SKU
-   An API token with the following scopes:
    -   `supergroups.read` to list supergroups and members
    -   `supergroups.read-write` to add or remove inclusion and exclusion members

* * *

## Fetch

### Supergroups

Use [GET List supergroups](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups) to get a `group_id`.

_Request:_

```json
curl -L -X GET 'https://rest.ripplingapis.com/supergroups/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Response:_

```json
{
  "results": [
    {
      "id": "65699280fb7bc7c3510f9043",
      "created_at": "2023-12-01T08:00:00.352000+00:00",
      "updated_at": "2024-03-19T22:17:47.664000+00:00",
      "display_name": "Engineering",
      "name": "Engineering",
      "app_owner_id": "65699281fb7bc7c3510f3ce2",
      "group_type": null,
      "sub_group_type": null,
      "read_only": false,
      "description": null,
      "parent": null,
      "mutually_exclusive_key": null,
      "cumulatively_exhaustive_default": false,
      "include_terminated": false,
      "allow_non_employees": false,
      "can_override_role_states": false,
      "priority": null,
      "is_invisible": false,
      "ignore_prov_group_matching": false
    }
  ],
}
```

| Response field | Description |
| --- | --- |
| `id` | Supergroup identifier. Use this as `group_id` on the member endpoints. |
| `created_at` | When the supergroup was created. |
| `updated_at` | When the supergroup was last updated. |
| `display_name` | The group's display name. |
| `name` | The group's name. |
| `app_owner_id` | Identifier of the app that owns the group. |
| `group_type` | The group type. |
| `sub_group_type` | The sub group type. |
| `read_only` | Whether the group is read only. |
| `description` | The group's description. |
| `parent` | Identifier of the parent group. |
| `mutually_exclusive_key` | Key used when groups in a set are mutually exclusive. |
| `cumulatively_exhaustive_default` | Whether this group is the default in a mutually exclusive set. |
| `include_terminated` | Whether terminated workers can be members. |
| `allow_non_employees` | Whether the group allows non-employees. |
| `can_override_role_states` | Whether the group can override role states. |
| `priority` | Priority used when calculating mutual exclusivity. |
| `is_invisible` | Whether the group is hidden. |
| `ignore_prov_group_matching` | Whether membership ignores the app provisioning group. |

### Members

Use [GET List supergroup members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-members) for the effective membership. Pass `expand=worker` to include worker records.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/supergroups/65699280fb7bc7c3510f9043/members/?expand=worker'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Response:_

```json
{
  "results": [
    {
      "id": "65699280fb7bc7c3510f9101",
      "created_at": "2023-12-01T08:00:00.352000+00:00",
      "updated_at": "2024-03-19T22:17:47.664000+00:00",
      "full_name": "Ada Lovelace",
      "work_email": "ada@example.com",
      "worker_id": "65699280fb7bc7c3510f9101",
      "worker": null
    }
  ],
}
```

| Response field | Description |
| --- | --- |
| `id` | Worker identifier. Same value as `worker_id`. |
| `created_at` | When the worker record was created. |
| `updated_at` | When the worker record was last updated. |
| `full_name` | The member's full name. |
| `work_email` | The member's work email address. |
| `worker_id` | The worker identifier associated with this member. |
| `worker` | The worker record. Returned only when you pass `expand=worker`. Otherwise null. |

### Inclusion members

Use [GET List supergroup inclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-inclusion-members) to list only inclusion members.

```json
curl -L -X GET 'https://rest.ripplingapis.com/supergroups/65699280fb7bc7c3510f9043/inclusion-members/' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer REDACTED' \
```

### Exclusion members

Use [GET List supergroup exclusion members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-exclusion-members) to list only excluded members.

```json
curl -L -X GET 'https://rest.ripplingapis.com/supergroups/65699280fb7bc7c3510f9043/exclusion-members/' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer REDACTED' \
```

* * *

## Update

### Inclusion members

Use [PATCH Update supergroup inclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-inclusion-members) to add or remove explicitly-included members. `op` can be `add` or `remove`, and `value` is the list of worker IDs.

_Request:_

```json
curl -L -X PATCH 'https://rest.ripplingapis.com/supergroups/65699280fb7bc7c3510f9043/inclusion-members/' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer REDACTED' \
```

_Request body:_

```json
{
  "Operations": [
    {
      "op": "add",
      "value": [
        { "id": "65699292fb7bc7c3510f4781" },
        { "id": "6569929efb7bc7c3510f48f3" }
      ]
    }
  ]
}
```

_Response:_

A successful update returns `{ "ok": true }` and does not return the member list.

```json
{
  "ok": true
}
```

To remove workers from an inclusion list, send the same body with `"op": "remove"`.

```json
{
  "Operations": [
    {
      "op": "remove",
      "value": [
        { "id": "65699292fb7bc7c3510f4781" },
        { "id": "6569929efb7bc7c3510f48f3" }
      ]
    }
  ]
}
```

### Exclusion members

Use [PATCH Update supergroup exclusion members](https://developer.rippling.com/documentation/rest-api/reference/update-supergroups-group-id-exclusion-members) to add or remove a member from the group's exclusion list. Adding a worker to the exclusion list removes them from the inclusion list, and they're also removed from the effective members ([GET List supergroup members](https://developer.rippling.com/documentation/rest-api/reference/list-supergroups-group-id-members)) list.

_Request:_

```json
curl -L -X PATCH 'https://rest.ripplingapis.com/supergroups/65699280fb7bc7c3510f9043/exclusion-members/' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer REDACTED' \
```

_Request body:_

```json
{
  "Operations": [
    {
      "op": "add",
      "value": [
        { "id": "65699280fb7bc7c3510f9101" }
      ]
    }
  ]
}
```

_Response:_

```json
{
  "ok": true
}
```

Send `"op": "remove"` to remove a worker from the exclusion list. This does not add them back to the inclusion list, and they will only rejoin the effective members list if a group rule matches them.

```json
{
  "Operations": [
    {
      "op": "remove",
      "value": [
        { "id": "65699280fb7bc7c3510f9101" }
      ]
    }
  ]
}
```

* * *

## See also

-   [Get started with the Supergroups API](https://developer.rippling.com/documentation/rest-api/guides/supergroups-getting-started)
-   [Introduction to Supergroups](https://help.rippling.com/article?articleId=945615220635)
-   [API tokens and permissions](https://developer.rippling.com/documentation/rest-api/essentials/api-tokens)

Source: https://developer.rippling.com/documentation/rest-api/guides/supergroup-members

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
