---
title: List groups
description: List groups in the organization. Results are paginated by startIndex and count parameters. Results can be narrowed down by the filter parameter.
breadcrumbs: Docs > API > List groups
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# List groups

## v2 (latest)

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

### Overview

List groups in the organization.
Results are paginated by `startIndex` and `count` parameters.
Results can be narrowed down by the `filter` parameter.

This endpoint requires all of the following permissions:

- `user_access_invite`
- `user_access_manage`

### Arguments

#### Query Strings

| Field      | Type    | Description                                                                                                                                                                                                                                                                  |
| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startIndex | integer | Specifies the start index to fetch the results (1-indexed). Default: `1`.                                                                                                                                                                                                    |
| count      | integer | Specifies the number of groups to be returned. Default: `20`.                                                                                                                                                                                                                |
| filter     | string  | Specifies the url encoded filter to use to narrow down the results. Filters can be in the form of `displayName eq <group name>` or `externalId eq <external id of group>` or `id eq <group id> and members eq <user uuid>` or `members eq <user uuid> and id eq <group id>`. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
List groups response object.

| Parent field | Field        | Type      | Description                                                              |
| ------------ | ------------ | --------- | ------------------------------------------------------------------------ |
|              | Resources    | [object]  | List of groups matching the request criteria.                            |
| Resources    | displayName  | string    | A human-readable name for the group.                                     |
| Resources    | externalId   | string    | An identifier for the resource as defined by the provisioning client.    |
| Resources    | id           | string    | The identifier of the resource. Not required when creating a group.      |
| Resources    | members      | [object]  | A list of members belonging to the team.                                 |
| members      | $ref         | string    | The URI corresponding to a resource that is a member of this group.      |
| members      | display      | string    | Full name of the user.                                                   |
| members      | type         | string    | A label indicating the type of resource. Only supported value is "User". |
| members      | value        | string    | The identifier of the member of this group.                              |
| Resources    | 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.                                                        |
| Resources    | schemas      | [string]  | Group JSON Schemas.                                                      |
|              | itemsPerPage | int64     | Number of groups returned per page.                                      |
|              | schemas      | [string]  | List response JSON Schemas.                                              |
|              | startIndex   | int64     | Starting index of the groups for this page (1-indexed).                  |
|              | totalResults | int64     | Total number of groups matching the request criteria.                    |
{% /tab %}

{% tab label="Example" %}
```json
{
  "Resources": [
    {
      "displayName": "Group 1",
      "externalId": "group1",
      "id": "e43536e9-33fe-43f8-90b8-d3e39a7dd6ad",
      "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"
        }
      ],
      "meta": {
        "created": "2024-11-22T15:05:52.055138963Z",
        "lastModified": "2024-11-22T15:05:52.055139017Z",
        "location": "https://app.datadoghq.com/api/scim/v2/Groups/e43536e9-33fe-43f8-90b8-d3e39a7dd6ad",
        "resourceType": "Group"
      },
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
      ]
    },
    {
      "displayName": "Group 2",
      "externalId": "group2",
      "id": "79ef0d28-f257-4829-97e6-d23d2a26cb1a",
      "members": [
        {
          "$ref": "https://app.datadoghq.com/api/scim/v2/Users/29da9fb7-8fca-4e87-bf58-86652253deae",
          "display": "Alice Smith",
          "type": "User",
          "value": "29da9fb7-8fca-4e87-bf58-86652253deae"
        },
        {
          "$ref": "https://app.datadoghq.com/api/scim/v2/Users/f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9",
          "display": "Bob Smith",
          "type": "User",
          "value": "f85e3868-ad7b-47e3-a8a9-ff1eade2bbf9"
        }
      ],
      "meta": {
        "created": "2024-11-22T15:05:52.055139748Z",
        "lastModified": "2024-11-22T15:05:52.055139813Z",
        "location": "https://app.datadoghq.com/api/scim/v2/Groups/79ef0d28-f257-4829-97e6-d23d2a26cb1a",
        "resourceType": "Group"
      },
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
      ]
    }
  ],
  "itemsPerPage": 2,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "startIndex": 1,
  "totalResults": 2
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
export DD_BEARER_TOKEN="<DD_BEARER_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/scim/Groups" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
