---
title: Decide makes feature decisions for the selected query parameters.
slug: feature-experimentation/api/decide-makes-feature-decisions-for-the-selected-query-parameters
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "RlqPzO0g11zgCKc6JuvFJ",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/v1/decide",
    "servers": [],
    "name": "Decide makes feature decisions for the selected query parameters.",
    "description": "<p>Returns decision results for flag keys for a user. The result for a single key is returned as an OptimizelyDecision object whereas the result for multiple keys is returned as an array of OptimizelyDecision objects. If no flag key is provided, decision is made for all flag keys. OptimizelyDecision object contains all data required to deliver the flag rule.</p>",
    "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": "keys",
          "type": "string",
          "description": "Flag keys for decision"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "DecideContext",
          "schema": [
            {
              "name": "decideOptions",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/DecideOption",
              "customType": "DecideOption[]",
              "schema": []
            },
            {
              "name": "userId",
              "kind": "required",
              "type": "string",
              "description": ""
            },
            {
              "name": "userAttributes",
              "kind": "optional",
              "type": "object",
              "description": "",
              "example": "",
              "schema": []
            },
            {
              "name": "forcedDecisions",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/ForcedDecision",
              "customType": "ForcedDecision[]",
              "schema": [
                {
                  "name": "flagKey",
                  "kind": "required",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "ruleKey",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "variationKey",
                  "kind": "required",
                  "type": "string",
                  "description": ""
                }
              ]
            },
            {
              "name": "fetchSegments",
              "kind": "optional",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "fetchSegmentsOptions",
              "kind": "optional",
              "type": "array",
              "description": "",
              "modelRef": "#/components/schemas/FetchSegmentsOption",
              "customType": "FetchSegmentsOption[]",
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/DecideContext",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "SdkKeyAuth",
          "name": "X-Optimizely-SDK-Key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        },
        {
          "id": "TokenAuth",
          "name": "TokenAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Valid response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "variables",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": []
                  },
                  {
                    "name": "variationKey",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "ruleKey",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "flagKey",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "userContext",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/UserContext",
                    "customType": "UserContext",
                    "schema": [
                      {
                        "name": "userId",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "attributes",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": []
                      }
                    ]
                  },
                  {
                    "name": "reasons",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ],
                "type": "array",
                "modelRef": "#/components/schemas/OptimizelyDecision",
                "customType": "OptimizelyDecision[]"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "variables",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": []
                  },
                  {
                    "name": "variationKey",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "ruleKey",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "flagKey",
                    "kind": "required",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "userContext",
                    "kind": "required",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/UserContext",
                    "customType": "UserContext",
                    "schema": [
                      {
                        "name": "userId",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "attributes",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": []
                      }
                    ]
                  },
                  {
                    "name": "reasons",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ],
                "modelRef": "#/components/schemas/OptimizelyDecision",
                "customType": "OptimizelyDecision"
              }
            ],
            "complexType": "oneOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Missing required parameters",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized, invalid JWT</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "You do not have necessary permissions for the resource",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "error",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Failed to fetch qualified segments",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /v1/decide \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"userId\": \"\",\n     \"forcedDecisions\": [\n     {\n     \"flagKey\": \"\",\n     \"variationKey\": \"\"\n     }\n     ]\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"userId\": \"\",\n   \"forcedDecisions\": [\n      {\n         \"flagKey\": \"\",\n         \"variationKey\": \"\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/v1/decide\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/decide\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"userId\": \"\",\n   \"forcedDecisions\": [\n      {\n         \"flagKey\": \"\",\n         \"variationKey\": \"\"\n      }\n   ]\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/decide\"\n\npayload = json.dumps({\n   \"userId\": \"\",\n   \"forcedDecisions\": [\n      {\n         \"flagKey\": \"\",\n         \"variationKey\": \"\"\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Valid response\n{}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Missing required parameters\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized, invalid JWT\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// You do not have necessary permissions for the resource\n{\n  \"error\": \"\"\n}"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Failed to fetch qualified segments\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}