# Patch group

`PATCH https://api.airtable.com/scim/v2/Groups/{groupId}`

SCIM patch an array of operations to a Group and applies them sequentially.

See [SCIM specification](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2) for more.

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`enterprise.scim.usersAndGroups:manage`](https://airtable.com/developers/web/api/scopes.md#enterprise-scim-users-and-groups-manage)
- **User role:** Enterprise admin _Note: Admins of multiple enterprises should use a service account's token when calling this route._
- **Billing plans:** Enterprise (pre-2023.08 legacy plan), Enterprise Scale

## Path parameters

- `groupId: string`

## Request body

- `schemas: array<string>` — required

  A list of schemas, including at least SCIM's PatchOp schema URI.

- `Operations: array<object>` — required

  A list of SCIM patch operations to perform.

  See the [SCIM PATCH protocol](https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2) for details.

  - `path: string` — required

    Path for a [SCIM group](https://airtable.com/api/enterprise#scimGroupFieldTypes) field.

  - `value: string | unknown` — optional

    Replacment value. Not used when performing the `'remove'` operation.

  - `op: "add" | "replace" | "remove"` — required

## Response format

See [SCIM Groups](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2)

- `id: string` — required

  A user group ID

- `schemas: array<string>` — required

  A list of schemas, including at least SCIM's core group schema URI.

- `displayName: string | null` — required

  Becomes the displayName of the group in Airtable. It must not be in use already.

- `members: array<object>` — optional

  List of members of the group.

  - `value: string` — required

    Represents the user ID of a group member

### Example — Patch user group example

```sh
curl -X PATCH "https://api.airtable.com/scim/v2/Groups/{groupId}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
    "Operations": [
      {
        "op": "add",
        "path": "members",
        "value": {
          "value": "usrI7HMkO7sAefUHk"
        }
      },
      {
        "op": "remove",
        "path": "members[value eq\"usrI7HMkO7sAefUHk\"]"
      },
      {
        "op": "replace",
        "path": "members",
        "value": [
          {
            "value": "usrI7HMkO7sAefUHk"
          }
        ]
      },
      {
        "op": "replace",
        "path": "displayName",
        "value": "Updated Example Group"
      }
    ],
    "schemas": [
      "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ]
  }'
```

```json
{
  "displayName": "Updated Example Group",
  "id": "ugpQ7PJ2boxzMAKFU",
  "members": [
    {
      "value": "usrI7HMkO7sAefUHk"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```
