---
title: Fetch a Single Exclusion Group
slug: feature-experimentation/api/fetch-a-single-exclusion-group
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "gsrifW46FR8G-zZoOjSsy",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id}",
    "servers": [
      {
        "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id}"
      }
    ],
    "name": "Fetch a Single Exclusion Group",
    "description": "<p>Fetch a single exclusion group by its id.</p>\n<p>This operation corresponds to the <code>fetch_group_url</code> in a Groups response.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer",
          "example": 12345,
          "description": "The project identifier"
        },
        {
          "kind": "required",
          "name": "group_id",
          "type": "integer",
          "example": 54321,
          "description": "The group identifier"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "Write applications that authenticate with the REST API via OAuth 2.0.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Grants all access"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Successful retrieval, creation or update of a Group.</p>\n<p>The response includes RESTful JSON (<a href=\"https://restfuljson.org/\" target=\"_blank\">https://restfuljson.org/</a>) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"archive_url\":\"/projects/12345/groups/archived\",\"archived\":false,\"created_time\":\"2019-05-08T00:00:00.000Z\",\"description\":\"Promo group description\",\"environment_key\":\"production\",\"id\":1,\"name\":\"Promo group\",\"project_id\":12345,\"revision\":1,\"role\":\"viewer\",\"rules\":{\"321\":{\"created_time\":\"2022-01-08T00:00:00.000Z\",\"flag_key\":\"recurring_revenue\",\"flag_name\":\"Recurring Revenue\",\"flag_status\":\"unarchived\",\"rule_key\":\"experiment_one\",\"rule_name\":\"Experiment One\",\"traffic_allocation\":2000,\"updated_time\":\"2022-01-08T00:00:00.000Z\"}},\"unarchive_url\":\"/projects/12345/groups/unarchived\",\"update_url\":\"/projects/12345/groups\",\"updated_time\":\"2019-05-08T00:00:00.000Z\",\"url\":\"/projects/12345/groups/123\",\"urn\":\"groups.flag.optimizely.com::1\"}",
            "description": "",
            "customType": "Group",
            "schema": [
              {
                "name": "archive_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "example": false
              },
              {
                "name": "created_time",
                "kind": "required",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "delete_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "",
                "example": "promotion group"
              },
              {
                "name": "environment_key",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "production",
                "minLength": 1
              },
              {
                "name": "id",
                "kind": "required",
                "type": "integer",
                "readOnly": true,
                "description": "",
                "example": 1
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "example": "PromoGroup"
              },
              {
                "name": "project_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "The ID of the Project this Group belongs to",
                "format": "int64"
              },
              {
                "name": "revision",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "Revision number for tracking changes"
              },
              {
                "name": "role",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "Granular permission role",
                "example": "admin"
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "GroupRuleMap",
                    "description": "",
                    "modelRef": "#/components/schemas/GroupRuleMap",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "unarchive_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "update_url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "updated_time",
                "kind": "required",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "",
                "example": "2019-05-08T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "url",
                "kind": "optional",
                "type": "object",
                "readOnly": true,
                "description": "Link to self",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "UrlValue",
                    "description": "",
                    "modelRef": "#/components/schemas/UrlValue",
                    "schema": []
                  }
                ],
                "schema": []
              },
              {
                "name": "urn",
                "kind": "required",
                "type": "string",
                "readOnly": true,
                "description": "The URN for the Group",
                "example": "groups.flag.optimizely.com::1"
              }
            ],
            "modelRef": "#/components/schemas/Group",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Malformed requests and invalid parameter names and types",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Do not have permission to perform the operation",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not found. No content",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "272SRXmKsnPRTnmzsWUzJ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "WT2WNfPqigN-2iv8FY8hk",
          "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://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "zY0Q5k0upmlyBCCbHBMAc",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id}\")\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": "-COSH8vdrbLiEFPKkW27E",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/flags/v1//projects/{project_id}/groups/{group_id}\"\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": "272SRXmKsnPRTnmzsWUzJ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful retrieval, creation or update of a Group.\nThe response includes RESTful JSON (https://restfuljson.org/) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.\n{\n  \"archive_url\": {},\n  \"archived\": false,\n  \"created_time\": \"2019-05-08T00:00:00.000Z\",\n  \"delete_url\": {},\n  \"description\": \"promotion group\",\n  \"environment_key\": \"production\",\n  \"id\": 1,\n  \"name\": \"PromoGroup\",\n  \"project_id\": \"\",\n  \"revision\": 0,\n  \"role\": \"admin\",\n  \"rules\": {},\n  \"unarchive_url\": {},\n  \"update_url\": {},\n  \"updated_time\": \"2019-05-08T00:00:00.000Z\",\n  \"url\": {},\n  \"urn\": \"groups.flag.optimizely.com::1\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Malformed requests and invalid parameter names and types\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Invalid credentials\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Do not have permission to perform the operation\n"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not found. No content\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}