---
title: Get user groups
slug: opti-id/api/get-user-groups
docTags: 
createdAt: 2026-10-01T19:58:50.958Z
---

{
  "id": "tk338s_OIpAh5Yda-sDg4",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://usermgmt-api.optimizely.com/api/usergroups",
    "servers": [
      {
        "url": "https://usermgmt-api.optimizely.com/api/usergroups"
      }
    ],
    "name": "Get user groups",
    "description": "Get a page of user groups.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "name",
          "type": "string",
          "description": "Name of the user group."
        },
        {
          "kind": "optional",
          "name": "description",
          "type": "string",
          "description": "Description of the user group."
        },
        {
          "kind": "optional",
          "name": "organizationId",
          "type": "string",
          "description": "Organization ID that the user group belongs to."
        },
        {
          "kind": "optional",
          "name": "groupOwner",
          "type": "string",
          "description": "Email address of the user group owner."
        },
        {
          "kind": "optional",
          "name": "properties",
          "type": "array",
          "description": "Additional properties of the user group.",
          "schema": [
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "value",
              "kind": "optional",
              "type": "string",
              "description": ""
            }
          ],
          "itemType": "object",
          "customType": "object[]"
        },
        {
          "kind": "optional",
          "name": "users",
          "type": "array",
          "description": "Email addresses of users in the user group.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "instanceIds",
          "type": "array",
          "description": "Instance IDs of the user group.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "roleIds",
          "type": "array",
          "description": "IDs of the roles in the user group.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "attributeIds",
          "type": "array",
          "description": "IDs of attributes for the user group.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "useExactMatchSearch",
          "type": "boolean",
          "description": "<p>True or false, indicating whether to perform an exact match or partial word search on the name parameter, if specified.</p>"
        },
        {
          "kind": "optional",
          "name": "matchAnyInstanceId",
          "type": "boolean",
          "description": "<p>True or false, indicating whether to match any ID you provide in instanceIds.</p>"
        },
        {
          "kind": "optional",
          "name": "groupTypes",
          "type": "array",
          "description": "<p>User group types. Possible values: 0 for Custom Defined, 1 for Internal Defined, 2 for Product Defined user group types.</p>",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "productIds",
          "type": "array",
          "description": "Product IDs associated with the user group.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "excludeTeams",
          "type": "boolean",
          "description": "<p>True or false, indicating whether to exclude Teams usergroups from the results. Defaults to true.</p>"
        },
        {
          "kind": "optional",
          "name": "size",
          "type": "integer<int32>",
          "description": "Number of results to include per page.",
          "format": "int32"
        },
        {
          "kind": "optional",
          "name": "offset",
          "type": "integer<int32>",
          "description": "Offset paging of results.",
          "format": "int32"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "oidc_auth",
          "name": "oidc_auth",
          "kind": "optional",
          "type": "oauth2",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://login.optimizely.com/oauth2/default/v1/authorize",
              "tokenUrl": "https://login.optimizely.com/oauth2/default/v1/token",
              "scopes": {
                "openid": "Identifies the request as an OpenID Connect request (required)",
                "profile": "Requests access to the end user's default profile claims",
                "email": "Requests access to the email and email_verified claims",
                "offline_access": "Requests a refresh token used to obtain more access tokens without re-prompting the user for authentication",
                "idx_instancepermissions": "Request Instance Permissions claim for use with Optimizely Products"
              }
            }
          },
          "requiredScopes": [
            "openid",
            "profile",
            "email",
            "offline_access",
            "idx_instancepermissions"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The user groups response.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "page_userGroup",
            "schema": [
              {
                "name": "totalItemCount",
                "kind": "optional",
                "type": "integer<int32>",
                "nullable": true,
                "description": "",
                "format": "int32"
              },
              {
                "name": "items",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "",
                "modelRef": "#/components/schemas/userGroup",
                "customType": "userGroup[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "organizationId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "groupOwner",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "userCount",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "",
                    "format": "int32"
                  },
                  {
                    "name": "groupType",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "",
                    "default": 0,
                    "format": "int32",
                    "enum": [
                      "0",
                      "1",
                      "2"
                    ]
                  },
                  {
                    "name": "properties",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/property",
                    "customType": "property[]",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "instancePermissions",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/instancePermissionsDescriptor",
                    "customType": "instancePermissionsDescriptor[]",
                    "schema": [
                      {
                        "name": "instanceId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "roles",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "modelRef": "#/components/schemas/roleDescriptor",
                        "customType": "roleDescriptor[]",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "properties",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/property",
                            "customType": "property[]",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": ""
                              },
                              {
                                "name": "value",
                                "kind": "optional",
                                "type": "string",
                                "nullable": true,
                                "description": ""
                              }
                            ]
                          },
                          {
                            "name": "attributes",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/attribute",
                            "customType": "attribute[]",
                            "schema": [
                              {
                                "name": "id",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "key",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "values",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "example": "",
                                "itemType": "string",
                                "customType": "string[]",
                                "itemExample": "",
                                "itemDefault": ""
                              },
                              {
                                "name": "instanceId",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "description",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "productId",
                                "kind": "optional",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "isActive",
                                "kind": "optional",
                                "type": "boolean",
                                "description": ""
                              },
                              {
                                "name": "created",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "modified",
                                "kind": "optional",
                                "type": "string<date-time>",
                                "description": "",
                                "format": "date-time"
                              },
                              {
                                "name": "links",
                                "kind": "optional",
                                "type": "array",
                                "nullable": true,
                                "description": "",
                                "modelRef": "#/components/schemas/link",
                                "customType": "link[]",
                                "schema": [
                                  {
                                    "name": "rel",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": ""
                                  },
                                  {
                                    "name": "href",
                                    "kind": "optional",
                                    "type": "string",
                                    "nullable": true,
                                    "description": ""
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "created",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "format": "date-time"
                  },
                  {
                    "name": "modified",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "format": "date-time"
                  },
                  {
                    "name": "links",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "",
                    "modelRef": "#/components/schemas/link",
                    "customType": "link[]",
                    "schema": [
                      {
                        "name": "rel",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "href",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      }
                    ]
                  }
                ]
              },
              {
                "name": "links",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "",
                "modelRef": "#/components/schemas/link",
                "customType": "link[]",
                "schema": [
                  {
                    "name": "rel",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  },
                  {
                    "name": "href",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/page_userGroup",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The request was invalid or cannot be otherwise served. An accompanying error message will explain further.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "validationError[]",
            "schema": [
              {
                "name": "field",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/validationError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized access to endpoint.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden access to endpoint.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "<p>A server error occurred, please try again.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "RF1jYbAhQq3c073CZXkrk",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://usermgmt-api.optimizely.com/api/usergroups?properties=array' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "exWljc2kCRO7Hn-1_FY1W",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://usermgmt-api.optimizely.com/api/usergroups?properties=array\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "RCh2PM7sZDREwAnSDot4p",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://usermgmt-api.optimizely.com/api/usergroups?properties=array\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "HDTsatcm6Z_dOqhpmXpcG",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://usermgmt-api.optimizely.com/api/usergroups?properties=array\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "RF1jYbAhQq3c073CZXkrk"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The user groups response.\n{\n  \"totalItemCount\": \"\",\n  \"items\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\",\n      \"description\": \"\",\n      \"organizationId\": \"\",\n      \"groupOwner\": \"\",\n      \"userCount\": \"\",\n      \"groupType\": \"\",\n      \"properties\": [\n        {\n          \"name\": \"\",\n          \"value\": \"\"\n        }\n      ],\n      \"instancePermissions\": [\n        {\n          \"instanceId\": \"\",\n          \"roles\": [\n            {\n              \"name\": \"\",\n              \"id\": \"\",\n              \"properties\": [\n                {\n                  \"name\": \"\",\n                  \"value\": \"\"\n                }\n              ],\n              \"attributes\": [\n                {\n                  \"id\": \"\",\n                  \"key\": \"\",\n                  \"values\": [\n                    \"\"\n                  ],\n                  \"instanceId\": \"\",\n                  \"type\": \"\",\n                  \"name\": \"\",\n                  \"description\": \"\",\n                  \"productId\": \"\",\n                  \"isActive\": false,\n                  \"created\": \"\",\n                  \"modified\": \"\",\n                  \"links\": [\n                    {\n                      \"rel\": \"\",\n                      \"href\": \"\"\n                    }\n                  ]\n                }\n              ]\n            }\n          ]\n        }\n      ],\n      \"created\": \"\",\n      \"modified\": \"\",\n      \"links\": [\n        {\n          \"rel\": \"\",\n          \"href\": \"\"\n        }\n      ]\n    }\n  ],\n  \"links\": [\n    {\n      \"rel\": \"\",\n      \"href\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// The request was invalid or cannot be otherwise served. An accompanying error message will explain further.\n[\n  {\n    \"field\": \"\",\n    \"code\": \"\",\n    \"message\": \"\"\n  }\n]"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized access to endpoint.\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Forbidden access to endpoint.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// A server error occurred, please try again.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}