---
title: Get Approval
slug: feature-experimentation/api/get-approval
docTags: 
createdAt: 2026-10-13T18:16:15.508Z
---

{
  "id": "_QolshAkcXfRRTJ3r6gNN",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "http://localhost:3002//projects/{project_id}/flags/{flag_key}/approval/{approval_id}",
    "servers": [
      {
        "url": "http://localhost:3002//projects/{project_id}/flags/{flag_key}/approval/{approval_id}",
        "description": "Local server"
      },
      {
        "url": "https://api.app.optimizely.com/flags-scheduling/projects/{project_id}/flags/{flag_key}/approval/{approval_id}",
        "description": "Production server"
      }
    ],
    "name": "Get Approval",
    "description": "Get Approval of a Flag\n",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer",
          "description": "The id of the Project for which the Approval is scoped to."
        },
        {
          "kind": "required",
          "name": "flag_key",
          "type": "string",
          "description": "The key of the Flag for which the Approval is for."
        },
        {
          "kind": "required",
          "name": "approval_id",
          "type": "integer",
          "description": "The id of the Approval"
        }
      ],
      "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": "Approval",
            "schema": [
              {
                "name": "archived",
                "kind": "required",
                "type": "boolean",
                "description": "",
                "example": false
              },
              {
                "name": "entity_name",
                "kind": "required",
                "type": "string",
                "description": "<p>The name of the entity this Approval relates to (e.g. Flag Name).</p>",
                "example": "Flag 123"
              },
              {
                "name": "entity_key",
                "kind": "required",
                "type": "string",
                "description": "<p>The key of the entity this Approval relates to (e.g. Flag Key).</p>",
                "example": "flag_123"
              },
              {
                "name": "entity_id",
                "kind": "required",
                "type": "integer",
                "description": "<p>The ID of the entity this Approval relates to (e.g. Flag ID).</p>",
                "example": 12345
              },
              {
                "name": "id",
                "kind": "required",
                "type": "integer",
                "description": "The approval ID.",
                "example": 1
              },
              {
                "name": "environment",
                "kind": "required",
                "type": "string",
                "description": "The environment where the action is happening.",
                "example": "development"
              },
              {
                "name": "environment_id",
                "kind": "required",
                "type": "integer",
                "description": "The ID of environment where the action is happening.",
                "example": 2345
              },
              {
                "name": "current_status_id",
                "kind": "required",
                "type": "integer",
                "description": "The current status ID.",
                "example": 3333
              },
              {
                "name": "schedule",
                "kind": "optional",
                "type": "object",
                "description": "Schedule details.",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "ScheduleTimeResponse",
                    "description": "",
                    "modelRef": "#/components/schemas/ScheduleTimeResponse",
                    "schema": [
                      {
                        "name": "date",
                        "kind": "optional",
                        "type": "string<date>",
                        "description": "<p>The schedule will run at this date. Expected format: yyyy-mm-dd.</p>",
                        "example": "2025-02-18",
                        "format": "date"
                      },
                      {
                        "name": "time",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The schedule will run at this time. Expected format: hh</p><div></div> (24 hour).<p></p>",
                        "example": "23:59",
                        "pattern": "^([01]?[0-9]|2[0-3]):([0-5][0-9])$"
                      },
                      {
                        "name": "time_zone",
                        "kind": "optional",
                        "type": "string",
                        "description": "The timezone information for the scheduled time.",
                        "example": "UTC"
                      },
                      {
                        "name": "utc_time",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "description": "The utc timestamp when the scheduled job will be executed.",
                        "example": "2025-02-18T23:59:59+00:00",
                        "format": "date-time"
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "actions",
                "kind": "required",
                "type": "array",
                "description": "List of actions to be performed.",
                "modelRef": "#/components/schemas/FlagScheduleAction",
                "customType": "FlagScheduleAction[]",
                "schema": [
                  {
                    "name": "subject",
                    "kind": "required",
                    "type": "object",
                    "description": "The subject details for flag action",
                    "example": "",
                    "schema": [
                      {
                        "name": "key",
                        "kind": "optional",
                        "type": "string",
                        "description": "The key of the subject"
                      },
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "description": "The type of the subject"
                      }
                    ]
                  },
                  {
                    "name": "changed_element",
                    "kind": "optional",
                    "type": "string",
                    "description": "The element to be changed."
                  },
                  {
                    "name": "value",
                    "kind": "required",
                    "type": "object",
                    "description": "<p>The value for changed_element.</p>",
                    "example": "",
                    "schema": []
                  }
                ]
              },
              {
                "name": "status_history",
                "kind": "required",
                "type": "array",
                "description": "History of status changes.",
                "modelRef": "#/components/schemas/StatusHistoryItem",
                "customType": "StatusHistoryItem[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "integer",
                    "description": "The ID of the status history item"
                  },
                  {
                    "name": "status",
                    "kind": "required",
                    "type": "string",
                    "description": "The status value"
                  },
                  {
                    "name": "user_id",
                    "kind": "required",
                    "type": "integer",
                    "description": "The ID of the user"
                  },
                  {
                    "name": "email",
                    "kind": "required",
                    "type": "string",
                    "description": "The email of the user"
                  },
                  {
                    "name": "reason",
                    "kind": "required",
                    "type": "string",
                    "description": "The reason for the status change"
                  }
                ]
              },
              {
                "name": "created_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "Timestamp when the schedule was created.",
                "example": "2024-02-06T12:00:00Z",
                "format": "date-time"
              },
              {
                "name": "updated_at",
                "kind": "required",
                "type": "string<date-time>",
                "description": "Timestamp when the schedule was last updated.",
                "example": "2024-02-06T12:00:00Z",
                "format": "date-time"
              },
              {
                "name": "created_by",
                "kind": "required",
                "type": "string",
                "description": "The user who created the schedule.",
                "example": "admin@example.com"
              },
              {
                "name": "schedule_job_status",
                "kind": "required",
                "type": "string<pending | in_queue | failed_to_queue | canceled | completed | failed | partially_failed>",
                "description": "The status of the scheduled job.",
                "example": "pending",
                "enum": [
                  "pending",
                  "in_queue",
                  "failed_to_queue",
                  "canceled",
                  "completed",
                  "failed",
                  "partially_failed"
                ]
              },
              {
                "name": "policy_id",
                "kind": "optional",
                "type": "integer",
                "description": "The ID of the approval policy that governs this approval.",
                "example": 42
              },
              {
                "name": "policy_name",
                "kind": "optional",
                "type": "string",
                "description": "The name of the approval policy that governs this approval.",
                "example": "Production Gate"
              },
              {
                "name": "is_current_user_approver",
                "kind": "optional",
                "type": "boolean",
                "nullable": true,
                "description": "<p>Whether the current user is an approver for this approval. true if the user can approve, false if not, null when the status is not pending or the approver cannot be resolved.</p>"
              }
            ],
            "modelRef": "#/components/schemas/Approval",
            "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": "PRJw5QgVfo2EDFBPsTJVw",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url http://localhost:3002//projects/{project_id}/flags/{flag_key}/approval/{approval_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "Uz_to9PtS5x7sfDI7VR2r",
          "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}/flags/{flag_key}/approval/{approval_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "PafT_LFW8k2u4lQm1eW63",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:3002//projects/{project_id}/flags/{flag_key}/approval/{approval_id}\")\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": "GfeyaIjTIwLERK3a9EUAa",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:3002//projects/{project_id}/flags/{flag_key}/approval/{approval_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": "PRJw5QgVfo2EDFBPsTJVw"
    },
    "results": {
      "languages": [
        {
          "id": "D4f4NCIYVPxPaT6dl8H_a",
          "language": "200",
          "code": "// Successful Response\n{\n  \"archived\": false,\n  \"entity_name\": \"Flag 123\",\n  \"entity_key\": \"flag_123\",\n  \"entity_id\": 12345,\n  \"id\": 1,\n  \"environment\": \"development\",\n  \"environment_id\": 2345,\n  \"current_status_id\": 3333,\n  \"schedule\": {},\n  \"actions\": [\n    {\n      \"subject\": {\n        \"key\": \"\",\n        \"type\": \"\"\n      },\n      \"changed_element\": \"\",\n      \"value\": {}\n    }\n  ],\n  \"status_history\": [\n    {\n      \"id\": 0,\n      \"status\": \"\",\n      \"user_id\": 0,\n      \"email\": \"\",\n      \"reason\": \"\"\n    }\n  ],\n  \"created_at\": \"2024-02-06T12:00:00Z\",\n  \"updated_at\": \"2024-02-06T12:00:00Z\",\n  \"created_by\": \"admin@example.com\",\n  \"schedule_job_status\": \"pending\",\n  \"policy_id\": 42,\n  \"policy_name\": \"Production Gate\",\n  \"is_current_user_approver\": false\n}"
        },
        {
          "id": "s9MM1g7Fpb2xUsbBIV76l",
          "language": "401",
          "code": "// Not Authenticated\n{\n  \"details\": \"\",\n  \"status\": 400\n}"
        },
        {
          "id": "9fIIjm-GHAWhriyEsYUC5",
          "language": "422",
          "code": "// Validation Error\n{\n  \"detail\": [\n    {\n      \"loc\": [\n        {}\n      ],\n      \"msg\": \"\",\n      \"type\": \"\"\n    }\n  ],\n  \"status\": 422\n}"
        }
      ],
      "selectedLanguageId": "D4f4NCIYVPxPaT6dl8H_a"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}