---
title: Update a pinned item
slug: graph/api/update-a-pinned-item
docTags: 
createdAt: 2026-08-28T18:28:55.472Z
---

{
  "id": "ixET1guoJxt9esWwxOBFj",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id}",
    "servers": [
      {
        "url": "https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id}"
      }
    ],
    "name": "Update a pinned item",
    "description": "Update a single pinned item",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "collectionId",
          "type": "string",
          "description": "pinned collection id"
        },
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "<p>pinned id (id)</p>"
        }
      ],
      "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": "PinnedItemPayload",
          "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
            }
          ],
          "modelRef": "#/components/schemas/PinnedItemPayload",
          "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": "object",
            "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": "NNVjed3wc89eRwDalVaqe",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"phrases\": \"\",\n     \"targetKey\": \"\",\n     \"priority\": 1000,\n     \"isActive\": true\n     }'"
        },
        {
          "id": "jRJ-W-q0ae2KDXo90aAr5",
          "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   \"phrases\": \"\",\n   \"targetKey\": \"\",\n   \"priority\": 1000,\n   \"isActive\": true\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "XGMuLsruAmslRG9teofZG",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"phrases\": \"\",\n   \"targetKey\": \"\",\n   \"priority\": 1000,\n   \"isActive\": true\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "h60VgddY2UaVnLt-cxl7L",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://cg.optimizely.com/api/pinned/collections/{collectionId}/items/{id}\"\n\npayload = json.dumps({\n   \"phrases\": \"\",\n   \"targetKey\": \"\",\n   \"priority\": 1000,\n   \"isActive\": True\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "NNVjed3wc89eRwDalVaqe"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Ok\n{\n  \"phrases\": \"\",\n  \"targetKey\": \"\",\n  \"language\": \"\",\n  \"priority\": \"\",\n  \"isActive\": false,\n  \"id\": \"\",\n  \"collectionId\": \"\",\n  \"createdAt\": \"\",\n  \"updatedAt\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}