---
title: Activate selected features and experiments for the given user.
slug: feature-experimentation/api/activate-selected-features-and-experiments-for-the-given-user
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "voRnBL6c884veMvRr2PGc",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/v1/activate",
    "servers": [],
    "name": "Activate selected features and experiments for the given user.",
    "description": "Returns Optimizely's decision about which features and experiments a given user is exposed to. Optionally sends an impression event to the Optimizely analytics backend for any decision made for an experiment. This endpoint consolidates key functionality from the Feature Experimentation SDKs into one convenient call.",
    "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": "featureKey",
          "type": "array",
          "description": "Key for the Optimizely Feature",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "experimentKey",
          "type": "array",
          "description": "Key for the Optimizely Experiment",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "disableTracking",
          "type": "boolean",
          "description": "Setting to true will disable impression tracking for experiments."
        },
        {
          "kind": "optional",
          "name": "type",
          "type": "object",
          "description": "Limit the decisions to either experiment or features",
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": [],
              "modelRef": "#/components/schemas/Type",
              "customType": "Type"
            },
            {
              "name": "object",
              "description": "Limit the decisions to either experiment or features",
              "schema": []
            }
          ],
          "complexType": "allOf"
        },
        {
          "kind": "optional",
          "name": "enabled",
          "type": "boolean",
          "description": "Filter the activation response to return only enabled decisions."
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "ActivateContext",
          "schema": [
            {
              "name": "userId",
              "kind": "optional",
              "type": "string",
              "description": ""
            },
            {
              "name": "userAttributes",
              "kind": "optional",
              "type": "object",
              "description": "",
              "example": "",
              "schema": []
            }
          ],
          "modelRef": "#/components/schemas/ActivateContext",
          "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": "array",
            "description": "",
            "customType": "Decision[]",
            "schema": [
              {
                "name": "featureKey",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "experimentKey",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "variationKey",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "",
                "modelRef": "#/components/schemas/Type",
                "customType": "Type",
                "schema": []
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "variables",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "error",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Decision",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad request, invalid parameters</p>",
        "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": "You do not have necessary permissions for the resource",
            "customType": "Forbidden",
            "schema": [],
            "modelRef": "#/components/responses/Forbidden",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": false,
    "examples": {
      "languages": [
        {
          "id": "fgyG7Ha0b8r-ZRjLPigYw",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url '/v1/activate?type=object' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "brl9HDORUt_wMC9bAKf32",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/v1/activate?type=object\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qqrg7uGJ9cKRgnbtJeLVi",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/activate?type=object\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "srdLu7F7RmUtOWAxZqABM",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/activate?type=object\"\n\npayload = {}\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": "fgyG7Ha0b8r-ZRjLPigYw"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Valid response\n[\n  {\n    \"featureKey\": \"\",\n    \"experimentKey\": \"\",\n    \"variationKey\": \"\",\n    \"type\": \"\",\n    \"enabled\": false,\n    \"variables\": {},\n    \"error\": \"\"\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad request, invalid 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{}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}