---
title: Search
slug: web-experimentation/api/fYfo-search
docTags: 
createdAt: 2026-10-02T13:15:18.296Z
---

{
  "id": "7Tli31T5mqLuQO9in5pN9",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.optimizely.com/v2/search",
    "servers": [
      {
        "url": "https://api.optimizely.com/v2/search"
      }
    ],
    "name": "Search",
    "description": "Search for entities in your account by text string",
    "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": "per_page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the maximum number of objects to return per request",
          "default": 25,
          "maximum": 100
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "Optional pagination argument that specifies the page to return. If you have 140 objects and you choose to return 100 objects per page you will be able to access the last 40 objects on page 2. The default value is 1.\n",
          "default": 1
        },
        {
          "kind": "required",
          "name": "query",
          "type": "string",
          "description": "The text to search for."
        },
        {
          "kind": "optional",
          "name": "project_id",
          "type": "array",
          "description": "Filters search results by Project ID. Specifying multiple Project IDs will search across all specified projects.",
          "schema": [],
          "itemType": "integer",
          "customType": "integer[]"
        },
        {
          "kind": "optional",
          "name": "type",
          "type": "array",
          "description": "Filters search results by entity type. Specifying multiple types will search across all types specified.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "type_expand",
          "type": "array",
          "description": "<p>Filters search results by experiment, rule or campaign types. Specifying multiple types will search across all types specified.</p>",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "project_type",
          "type": "array",
          "description": "Filters search results by project type. Specifying multiple types will search across all types specified.",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "expand",
          "type": "array",
          "description": "Include the project name with the search result",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "archived",
          "type": "boolean",
          "description": "Whether or not to include archived entities in the search results. If this parameter is not provided it will default to false and no archived entities will be included.",
          "default": false
        },
        {
          "kind": "optional",
          "name": "fullsearch",
          "type": "boolean",
          "description": "Whether or not to perform full document search for the given search keyword. If this parameter is not provided it will default to false.",
          "default": false
        },
        {
          "kind": "optional",
          "name": "status",
          "type": "array",
          "description": "<p>Filters search results by the current status of the entity if it has one. Works for Experiments and Campaigns, and it may work for others. Specifying multiple statuses will search for entities with ANY of those statuses.</p>",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "sort",
          "type": "string",
          "description": "<p>The property to sort by. Built-in fields: id, name, status, created, last_modified, experiment_type. Custom fields: custom_field:: where type is text or num. For example, sort=custom_field:num</p><div></div>. Custom field sorts are only supported when the type parameter is limited to campaign and/or experiment, the only types that store custom field values; other types return 400.<p></p>"
        },
        {
          "kind": "optional",
          "name": "order",
          "type": "string",
          "description": "The property to sort by."
        },
        {
          "kind": "optional",
          "name": "environment_key",
          "type": "string",
          "description": "<p>Filters search result by environment_key when applicable</p>"
        },
        {
          "kind": "optional",
          "name": "audience_id",
          "type": "array",
          "description": "<p>Filters search result by audience_id when applicable</p>",
          "schema": [],
          "itemType": "integer",
          "customType": "integer[]"
        }
      ],
      "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 search results",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "SearchResult[]",
            "schema": [
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether or not the entity is archived.",
                "example": "False"
              },
              {
                "name": "audience_ids",
                "kind": "optional",
                "type": "array",
                "description": "A list of Audience IDs used in the Experiment",
                "example": "",
                "itemType": "integer",
                "customType": "integer[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "campaign_type",
                "kind": "optional",
                "type": "string",
                "description": "Type of campaing.",
                "example": "personalization"
              },
              {
                "name": "created",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The time that the entity was created.",
                "format": "date-time"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Description for the entity if it has one.",
                "example": "Test out the hero image on the home page"
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Wheter or not the environment is enabled or not",
                "example": "False"
              },
              {
                "name": "environment_key",
                "kind": "optional",
                "type": "string",
                "description": "The environment key of a given rule",
                "example": "development"
              },
              {
                "name": "event_type",
                "kind": "optional",
                "type": "string",
                "description": "Type of event.",
                "example": "custom"
              },
              {
                "name": "experiment_count",
                "kind": "optional",
                "type": "integer",
                "description": "<p>Number of experiments by audience_id</p>",
                "example": 123
              },
              {
                "name": "experiment_type",
                "kind": "optional",
                "type": "string",
                "description": "The type of experiment",
                "example": "a/b"
              },
              {
                "name": "feature_key",
                "kind": "optional",
                "type": "string",
                "description": "The feature flag key",
                "example": "my_feature_flag"
              },
              {
                "name": "feature_name",
                "kind": "optional",
                "type": "string",
                "description": "<p>The feature flag name to display in the Optimizely app. Whitespaces and other non-alphanumeric characters allowed. Defaults to feature key if left empty.</p>",
                "example": "the user search feature"
              },
              {
                "name": "flag_key",
                "kind": "optional",
                "type": "string",
                "description": "The Flag key",
                "example": "my_flag_key"
              },
              {
                "name": "group_id",
                "kind": "optional",
                "type": "integer",
                "description": "The id of the group that the rule belongs to.",
                "example": 123
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "ID of the entity"
              },
              {
                "name": "key",
                "kind": "optional",
                "type": "string",
                "description": "Key of the entity.",
                "example": "hero_image_test"
              },
              {
                "name": "last_modified",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The time that the entity was last modified.",
                "format": "date-time"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name of the entity. This value will be the 'key' of the entity if there is no name.",
                "example": "Hero Image Test"
              },
              {
                "name": "page_id",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "The Page ID associated with an Event",
                "format": "int64"
              },
              {
                "name": "project_id",
                "kind": "optional",
                "type": "integer",
                "description": "<p>ID of the project that contains the entity (if applicable)</p>"
              },
              {
                "name": "project_name",
                "kind": "optional",
                "type": "string",
                "description": "<p>Name of the project that contains the entity (if applicable)</p>"
              },
              {
                "name": "rule_type",
                "kind": "optional",
                "type": "string",
                "description": "Type of rule.",
                "example": "a/b"
              },
              {
                "name": "ruleset_enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Wheter or not the a rule is enabled in a ruleset",
                "example": "False"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "The current status for the entity if it has one.",
                "example": "running"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string<experiment | campaign | feature | audience | page | event | flag | rule | extension>",
                "description": "Type of the entity.",
                "example": "experiment",
                "enum": [
                  "experiment",
                  "campaign",
                  "feature",
                  "audience",
                  "page",
                  "event",
                  "flag",
                  "rule",
                  "extension"
                ]
              },
              {
                "name": "updated_time",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The time that the flag entity was last modified.",
                "format": "date-time"
              },
              {
                "name": "variation_specific",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether or not an event is variation specific",
                "example": false
              }
            ],
            "modelRef": "#/components/schemas/SearchResult",
            "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 search the specified Account or Project",
        "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": "fg2yzFQvyWlqGGnwHSeCz",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.optimizely.com/v2/search?per_page=25&page=1&query=string&archived=boolean&fullsearch=boolean' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "dVnELs3JYWp_PhRgpqwIf",
          "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/search?per_page=25&page=1&query=string&archived=boolean&fullsearch=boolean\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "hOALfr9uHf-5VMx0MCkWW",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/v2/search?per_page=25&page=1&query=string&archived=boolean&fullsearch=boolean\")\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": "QDSdUFZB9B9eQJ0870KXK",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/v2/search?per_page=25&page=1&query=string&archived=boolean&fullsearch=boolean\"\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": "fg2yzFQvyWlqGGnwHSeCz"
    },
    "results": {
      "languages": [
        {
          "id": "pBg5tvfONqkTx_bfFqIdR",
          "language": "200",
          "code": "// Return search results\n[\n  {\n    \"archived\": \"False\",\n    \"audience_ids\": [\n      0\n    ],\n    \"campaign_type\": \"personalization\",\n    \"created\": \"\",\n    \"description\": \"Test out the hero image on the home page\",\n    \"enabled\": \"False\",\n    \"environment_key\": \"development\",\n    \"event_type\": \"custom\",\n    \"experiment_count\": 123,\n    \"experiment_type\": \"a/b\",\n    \"feature_key\": \"my_feature_flag\",\n    \"feature_name\": \"the user search feature\",\n    \"flag_key\": \"my_flag_key\",\n    \"group_id\": 123,\n    \"id\": 0,\n    \"key\": \"hero_image_test\",\n    \"last_modified\": \"\",\n    \"name\": \"Hero Image Test\",\n    \"page_id\": \"\",\n    \"project_id\": 0,\n    \"project_name\": \"\",\n    \"rule_type\": \"a/b\",\n    \"ruleset_enabled\": \"False\",\n    \"status\": \"running\",\n    \"type\": \"experiment\",\n    \"updated_time\": \"\",\n    \"variation_specific\": false\n  }\n]"
        },
        {
          "id": "4rGD-rt9KwdxaIYe617ZO",
          "language": "401",
          "code": "// Invalid credentials\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "iccT8_-wR5KFMzEonbUzF",
          "language": "403",
          "code": "// You do not have permission to search the specified Account or Project\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "l3KASVJ_FZHICBnjyU7ru",
          "language": "default",
          "code": "// Unexpected error\n{\n  \"code\": \"\",\n  \"message\": \"\",\n  \"messages\": {},\n  \"uuid\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "pBg5tvfONqkTx_bfFqIdR"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}