---
title: Patch group
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > SCIM
---

# Patch group{% #patch-group %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                      |
| ----------------- | ----------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/scim/Groups/{group_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/scim/Groups/{group_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/scim/Groups/{group_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/scim/Groups/{group_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/scim/Groups/{group_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/scim/Groups/{group_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/scim/Groups/{group_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/scim/Groups/{group_id} |

### Overview

Patch the group with the given `group_id`. This endpoint requires all of the following permissions:
`user_access_invite``user_access_manage` 


### Arguments

#### Path Parameters

| Name                       | Type   | Description |
| -------------------------- | ------ | ----------- |
| group_id [*required*] | string | None        |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field      | Type     | Description                                                                      |
| ------------ | ---------- | -------- | -------------------------------------------------------------------------------- |
|              | Operations | [object] | A list of update operations to be performed on a group.                          |
| Operations   | op         | enum     | The operation to be performed. Allowed enum values: `add,replace,remove`         |
| Operations   | path       | string   | An attribute path describing the target of the operation.                        |
| Operations   | value      |          | JSON element containing the target values required to apply the patch operation. |
|              | schemas    | [string] | Input JSON Schemas                                                               |

{% /tab %}

{% tab title="Example" %}

```json
{
  "Operations": [
    {
      "op": "string",
      "path": "members",
      "value": "{\n    \"displayName\": \"Real new group\",\n    \"id\": \"80df3a9b-24f5-4ebf-9ba0-714455453621\"\n}"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Definition of a group.

| Parent field | Field        | Type      | Description                                                              |
| ------------ | ------------ | --------- | ------------------------------------------------------------------------ |
|              | displayName  | string    | A human-readable name for the group.                                     |
|              | externalId   | string    | An identifier for the resource as defined by the provisioning client.    |
|              | id           | string    | The identifier of the resource. Not required when creating a group.      |
|              | members      | [object]  | Members of the group.                                                    |
| members      | $ref         | string    | The URI corresponding to a SCIM resource that is a member of this group. |
| members      | display      | string    | A human-readable name for the group member.                              |
| members      | type         | string    | A label indicating the type of resource.                                 |
| members      | value        | string    | The identifier of the member of this group.                              |
|              | meta         | object    | Metadata associated with a group.                                        |
| meta         | created      | date-time | The date and time the group was created.                                 |
| meta         | lastModified | date-time | The date and time the group was last changed.                            |
| meta         | location     | string    | URL identifying the resource.                                            |
| meta         | resourceType | string    | Type of resource.                                                        |
|              | schemas      | [string]  | Input JSON Schemas.                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "displayName": "string",
  "externalId": "string",
  "id": "string",
  "members": [
    {
      "$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6",
      "display": "John Doe",
      "type": "User",
      "value": "429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6"
    }
  ],
  "meta": {
    "created": "2024-10-17T12:53:35.793Z",
    "lastModified": "2024-10-19T12:53:35.793Z",
    "location": "https://app.datadoghq.com/api/scim/v2/Groups/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6",
    "resourceType": "Group"
  },
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export group_id="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/scim/Groups/${group_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "Operations": [
    {
      "op": "replace",
      "path": "None",
      "value": {
        "displayName": "Real new group",
        "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad"
      }
    },
    {
      "op": "add",
      "path": "None",
      "value": {
        "members": [
          {
            "$ref": "https://app.datadoghq.com/api/scim/v2/Users/f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9",
            "displayName": "Bob Smith",
            "value": "f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9"
          }
        ]
      }
    },
    {
      "op": "remove",
      "path": "members[value eq \"fddf0cf2-9b60-11ef-ad4b-d6754a54a839\"]",
      "value": null
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
EOF \## json-request-body
# 
 \# Path parameters export group_id="CHANGE_ME" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/scim/Groups/${group_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "Operations": [
    {
      "op": "replace",
      "path": "None",
      "value": {
        "displayName": "Real new group",
        "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad"
      }
    },
    {
      "op": "add",
      "path": "None",
      "value": {
        "members": [
          {
            "$ref": "https://app.datadoghq.com/api/scim/v2/Users/f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9",
            "displayName": "Bob Smith",
            "value": "f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9"
          }
        ]
      }
    },
    {
      "op": "remove",
      "path": "members[value eq \"fddf0cf2-9b60-11ef-ad4b-d6754a54a839\"]",
      "value": null
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ]
}
EOF 
                
{% /tab %}
