---
title: Lookup returns saved user profile.
slug: feature-experimentation/api/lookup-returns-saved-user-profile
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "eQlK8lFPGW6MPM6iJG366",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/v1/lookup",
    "servers": [],
    "name": "Lookup returns saved user profile.",
    "description": "Returns the saved user profile for a user.",
    "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": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "LookupContext",
          "schema": [
            {
              "name": "userId",
              "kind": "required",
              "type": "string",
              "description": ""
            }
          ],
          "modelRef": "#/components/schemas/LookupContext",
          "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": "",
            "customType": "UserProfile",
            "schema": [
              {
                "name": "experimentBucketMap",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/ExperimentBucketMap",
                "customType": "ExperimentBucketMap",
                "schema": [
                  {
                    "name": "your_experiment_id",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/components/schemas/YourExperimentId",
                    "customType": "YourExperimentId",
                    "schema": [
                      {
                        "name": "variation_id",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  }
                ]
              },
              {
                "name": "userId",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/UserProfile",
            "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": "User Profile Service not found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": false,
    "examples": {
      "languages": [
        {
          "id": "3qoXQioe5pYnSoInIfK8n",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /v1/lookup \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"userId\": \"\"\n     }'"
        },
        {
          "id": "CyXa3eO8EaQLAs5vfAddc",
          "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});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"/v1/lookup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "gX-uokh_tUHD481Aif1K1",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/lookup\")\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})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "08RpA3G-x9Nc6pk9J0wTG",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/lookup\"\n\npayload = json.dumps({\n   \"userId\": \"\"\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": "3qoXQioe5pYnSoInIfK8n"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Valid response\n{\n  \"experimentBucketMap\": {\n    \"your_experiment_id\": {\n      \"variation_id\": \"\"\n    }\n  },\n  \"userId\": \"\"\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": "// User Profile Service not found\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}