---
title: Get bucketing information for a visitor
slug: web-experimentation/api/get-bucketing-information-for-a-visitor
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "czpHCWhBshZDB3aH3ryJk",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_id}",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_id}"
      }
    ],
    "name": "Get bucketing information for a visitor",
    "description": "Get a list of experiments within a project a visitor has been exposed to",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "account_id",
          "type": "integer<int64>",
          "description": "The unique identifier of the Optimizely Account",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "visitor_id",
          "type": "string",
          "description": "The Optimizely User ID of the visitor"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "start_time",
          "type": "string<date-time>",
          "description": "<p>Start of the time interval (inclusive) used to filter the bucketing decisions. The time is formatted in ISO 8601.</p>",
          "format": "date-time"
        },
        {
          "kind": "optional",
          "name": "end_time",
          "type": "string<date-time>",
          "description": "<p>End of the time interval (inclusive) used to filter the bucketing decisions. The time is formatted in ISO 8601.</p>",
          "format": "date-time"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "<p>Write applications that authenticate with the REST API via OAuth 2.0. Or, to authenticate using 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>",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Full access to your account"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Return bucketing information",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "BucketingInformation",
            "schema": [
              {
                "name": "account_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "ID of the Account",
                "example": 1000,
                "format": "int64"
              },
              {
                "name": "bucketing_history",
                "kind": "optional",
                "type": "array",
                "description": "Array of bucketing information items",
                "modelRef": "#/components/schemas/BucketingInformationItem",
                "customType": "BucketingInformationItem[]",
                "schema": [
                  {
                    "name": "campaign_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "The unique identifier of the Campaign",
                    "example": 2056053765,
                    "format": "int64"
                  },
                  {
                    "name": "experiment_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "The unique identifier of the Experiment",
                    "example": 9387397797,
                    "format": "int64"
                  },
                  {
                    "name": "is_holdback",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Is the visitor bucketed into a variation or a holdback"
                  },
                  {
                    "name": "timestamp",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "The timestamp of the bucketing decision on the client side",
                    "example": 1545871675000,
                    "format": "int64"
                  },
                  {
                    "name": "variation_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "The unique identifier of the Variation",
                    "example": 5042153527,
                    "format": "int64"
                  }
                ]
              },
              {
                "name": "visitor_id",
                "kind": "optional",
                "type": "string<uuid>",
                "readOnly": true,
                "description": "The unique identifier of the visitor",
                "example": "fa74a14b-1f3a-463d-aa98-2f7124ee6fc3",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/BucketingInformation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "You do not have permission to access bucketing history information",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "Unexpected error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": []
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "LknvG07cgikqrdis3Jtoo",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "eJ6DwuGWyxVfpv74sWfqT",
          "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(\"https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "yR1yPY8pdks6LAopficsK",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ZMP7okYAyjvrnVZkHHovF",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/attribution/{account_id}/visitor/{visitor_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": "LknvG07cgikqrdis3Jtoo"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Return bucketing information\n{\n  \"account_id\": 1000,\n  \"bucketing_history\": [\n    {\n      \"campaign_id\": 2056053765,\n      \"experiment_id\": 9387397797,\n      \"is_holdback\": false,\n      \"timestamp\": 1545871675000,\n      \"variation_id\": 5042153527\n    }\n  ],\n  \"visitor_id\": \"fa74a14b-1f3a-463d-aa98-2f7124ee6fc3\"\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Invalid credentials\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// You do not have permission to access bucketing history information\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-3-default",
          "language": "default",
          "code": "// Unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}