---
title: Get pinned results
slug: graph/api/get-pinned-results
docTags: 
createdAt: 2026-08-28T18:28:55.472Z
---

{
  "id": "e1xXkP9WyigL9jkqLLtl4",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://cg.optimizely.com/api/pinned/results",
    "servers": [
      {
        "url": "https://cg.optimizely.com/api/pinned/results"
      }
    ],
    "name": "Get pinned results",
    "description": "Get pinned results by matching phrases",
    "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": "PinnedResultMatchParams",
          "schema": [
            {
              "name": "phrase",
              "kind": "required",
              "type": "string",
              "description": ""
            },
            {
              "name": "collectionIds",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "collectionKeys",
              "kind": "optional",
              "type": "array",
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "languages",
              "kind": "optional",
              "type": "array",
              "nullable": true,
              "description": "",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "onlyActive",
              "kind": "optional",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "limit",
              "kind": "optional",
              "type": "number<double>",
              "description": "",
              "format": "double"
            }
          ],
          "modelRef": "#/components/schemas/PinnedResultMatchParams",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "epi-hmac",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>HMAC authentication (<code>epi-hmac xxx</code>)</p>",
          "in": "header"
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "description": "JWT token",
          "scheme": "bearer"
        },
        {
          "id": "Basic",
          "name": "Basic",
          "kind": "optional",
          "type": "http",
          "description": "HMAC credentials",
          "scheme": "basic"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Ok",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "PinnedItemResult[]",
            "schema": [
              {
                "name": "phrases",
                "kind": "required",
                "type": "string",
                "description": "Phrase or keyword to match"
              },
              {
                "name": "targetKey",
                "kind": "required",
                "type": "string",
                "description": "Document id to pin"
              },
              {
                "name": "language",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p>Language code (e.g. <code>en</code>, <code>fr</code>, <code>de</code>, etc.)</p>\n<ul>\n<li>\n<p><code>null</code> value means the pinned item is applicable to all languages</p>\n</li>\n<li>\n<p>Empty string (<code>\"\"</code>) value is for NEUTRAL locale</p>\n</li>\n</ul>",
                "default": null
              },
              {
                "name": "priority",
                "kind": "optional",
                "type": "number<double>",
                "description": "<p>Priority of the pinned item (lower number means lower priority)</p>\n<ul>\n<li>\n<p>Default value is <code>1000</code></p>\n</li>\n<li>\n<p>Example: <code>1</code>, <code>10</code>, <code>100</code>, etc.</p>\n</li>\n</ul>",
                "default": 1000,
                "format": "double"
              },
              {
                "name": "isActive",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "default": true
              },
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "collectionId",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "createdAt",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "updatedAt",
                "kind": "required",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/PinnedItemResult",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "wdW4gJVkxDDsCoX-m35lt",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://cg.optimizely.com/api/pinned/results \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"phrase\": \"\"\n     }'"
        },
        {
          "id": "fFP0ilOISNWGXDfTdotQT",
          "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   \"phrase\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://cg.optimizely.com/api/pinned/results\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nVwzv6KHgHd-Wg2KHaI9_",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://cg.optimizely.com/api/pinned/results\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"phrase\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "TeWVNM0zlw_xML1rAxS8e",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://cg.optimizely.com/api/pinned/results\"\n\npayload = json.dumps({\n   \"phrase\": \"\"\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": "wdW4gJVkxDDsCoX-m35lt"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Ok\n[\n  {\n    \"phrases\": \"\",\n    \"targetKey\": \"\",\n    \"language\": \"\",\n    \"priority\": \"\",\n    \"isActive\": false,\n    \"id\": \"\",\n    \"collectionId\": \"\",\n    \"createdAt\": \"\",\n    \"updatedAt\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}