---
title: Get Environment Approval Settings
slug: feature-experimentation/api/get-environment-approval-settings
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "f4R_VklfEu0PYjpRd1sxM",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences",
    "servers": [
      {
        "url": "http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences",
        "description": "Local server"
      },
      {
        "url": "https://api.app.optimizely.com/flags-scheduling/projects/{project_id}/environments/{environment_id}/preferences",
        "description": "Production server"
      }
    ],
    "name": "Get Environment Approval Settings",
    "description": "Get the approval settings for a specific environment in a project.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer",
          "description": "The id of the project for which the schedule is set."
        },
        {
          "kind": "required",
          "name": "environment_id",
          "type": "integer",
          "description": "The id of the project for which the schedule is set."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "BearerAuth",
          "name": "BearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>To get a personal token, see <a href=\"https://docs.developers.optimizely.com/web/docs/personal-token\" target=\"_blank\">https://docs.developers.optimizely.com/web/docs/personal-token</a></p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful Response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "EnvironmentApprovalSettingsResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "integer",
                "description": "The unique identifier for the schedule"
              },
              {
                "name": "project_id",
                "kind": "required",
                "type": "integer",
                "description": "The project id where the environment belongs"
              },
              {
                "name": "environment_id",
                "kind": "required",
                "type": "integer",
                "description": "The environment id where action is happening"
              },
              {
                "name": "entity_type",
                "kind": "required",
                "type": "string",
                "description": "The setting's entity type"
              },
              {
                "name": "require_approval_on_new_entities",
                "kind": "required",
                "type": "boolean",
                "description": "Denotes approval required status for new entities"
              },
              {
                "name": "default_preferences",
                "kind": "optional",
                "type": "object",
                "description": "Default rules related with environment approval setting",
                "example": "",
                "schema": [
                  {
                    "name": "audiences",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "metrics",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "ramp_perc",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "rules",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "ruleset",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "variations",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  }
                ]
              },
              {
                "name": "notification_recipients",
                "kind": "required",
                "type": "array",
                "description": "List of notification recipients associated with the environment approval settings",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "approvers",
                "kind": "required",
                "type": "array",
                "description": "List of approvers",
                "modelRef": "#/components/schemas/ApproversResponse",
                "customType": "ApproversResponse[]",
                "schema": [
                  {
                    "name": "user_id",
                    "kind": "required",
                    "type": "string",
                    "description": "The user id of the approver user"
                  },
                  {
                    "name": "email",
                    "kind": "required",
                    "type": "string",
                    "description": "The email of the approver user"
                  }
                ]
              },
              {
                "name": "entities",
                "kind": "required",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "approver_assignment_mode",
                "kind": "optional",
                "type": "string",
                "description": "How approvers are assigned to approval requests",
                "modelRef": "#/components/schemas/ApproverAssignmentMode",
                "customType": "ApproverAssignmentMode",
                "schema": []
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "A description of the approval settings"
              },
              {
                "name": "created_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "Timestamp when the settings are created",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "Timestamp when the settings are updated",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/EnvironmentApprovalSettingsResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Not Authenticated",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"details\":\"Not authenticated\",\"status\":401}",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "details",
                "kind": "required",
                "type": "string",
                "description": "Details of Error."
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer",
                "description": "Status code of the response.",
                "example": 400
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Validation Error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "HTTPValidationError",
            "schema": [
              {
                "name": "detail",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/ValidationError",
                "customType": "ValidationError[]",
                "schema": [
                  {
                    "name": "loc",
                    "kind": "required",
                    "type": "array",
                    "description": "Path to the invalid value",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "msg",
                    "kind": "required",
                    "type": "string",
                    "description": "Error message"
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string",
                    "description": "Error type"
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "integer",
                "description": "Status code of the response.",
                "example": 422
              }
            ],
            "modelRef": "#/components/schemas/HTTPValidationError",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "xCD7HsPRJrL51iqjt0wF0",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences \\\n     --header 'accept: application/json'"
        },
        {
          "id": "tAFGNd5gjtVHkawqbF6an",
          "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(\"http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "S8iBxotFKjAuku6gdBXRT",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "mpX3YAKMcBtyFEVHixHyo",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:3002//projects/{project_id}/environments/{environment_id}/preferences\"\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": "xCD7HsPRJrL51iqjt0wF0"
    },
    "results": {
      "languages": [
        {
          "id": "N9YLPk_SAccy0YiCdintX",
          "language": "200",
          "code": "// Successful Response\n{\n  \"id\": 0,\n  \"project_id\": 0,\n  \"environment_id\": 0,\n  \"entity_type\": \"\",\n  \"require_approval_on_new_entities\": false,\n  \"default_preferences\": {\n    \"audiences\": false,\n    \"metrics\": false,\n    \"ramp_perc\": false,\n    \"rules\": false,\n    \"ruleset\": false,\n    \"variations\": false\n  },\n  \"notification_recipients\": [\n    \"\"\n  ],\n  \"approvers\": [\n    {\n      \"user_id\": \"\",\n      \"email\": \"\"\n    }\n  ],\n  \"entities\": [\n    {}\n  ],\n  \"approver_assignment_mode\": \"\",\n  \"description\": \"\",\n  \"created_at\": \"\",\n  \"updated_at\": \"\"\n}"
        },
        {
          "id": "zf4ae_wdT-Z61iK5edrKB",
          "language": "401",
          "code": "// Not Authenticated\n{\n  \"details\": \"\",\n  \"status\": 400\n}"
        },
        {
          "id": "RzngJYgojiCq87_5ZlAP6",
          "language": "422",
          "code": "// Validation Error\n{\n  \"detail\": [\n    {\n      \"loc\": [\n        {}\n      ],\n      \"msg\": \"\",\n      \"type\": \"\"\n    }\n  ],\n  \"status\": 422\n}"
        }
      ],
      "selectedLanguageId": "N9YLPk_SAccy0YiCdintX"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}