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

# Create group{% #create-group %}

{% tab title="v2" %}

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

### Overview

Create a new group. The group may contain members. This endpoint requires all of the following permissions:
`user_access_invite``user_access_manage` 


### Request

#### Body Data (required)



{% tab title="Model" %}

| 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 %}

### Response

{% tab title="201" %}
Created
{% 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="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
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/scim/Groups" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "displayName": "Group 1",
  "externalId": "group1",
  "members": [
    {
      "$ref": "https://app.datadoghq.com/api/scim/v2/Users/d34a5f93-5690-4d3f-a293-f2ad5c7a82a4",
      "display": "John Doe",
      "type": "User",
      "value": "d34a5f93-5690-4d3f-a293-f2ad5c7a82a4"
    },
    {
      "$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6",
      "display": "Jane Doe",
      "type": "User",
      "value": "429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
EOF \## json-request-body
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/scim/Groups" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "displayName": "Group 1",
  "externalId": "group1",
  "members": [
    {
      "$ref": "https://app.datadoghq.com/api/scim/v2/Users/d34a5f93-5690-4d3f-a293-f2ad5c7a82a4",
      "display": "John Doe",
      "type": "User",
      "value": "d34a5f93-5690-4d3f-a293-f2ad5c7a82a4"
    },
    {
      "$ref": "https://app.datadoghq.com/api/scim/v2/Users/429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6",
      "display": "Jane Doe",
      "type": "User",
      "value": "429ebce5-8ed3-4da9-9f1e-662f2dbc2fe6"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ]
}
EOF 
                
{% /tab %}
