---
title: Update Policy Key
slug: single-connect-api-3-2-0/update-policy-key
description: Learn how to update a policy key using a cURL command in this code example. Make a POST request with the specified URL, headers, and data to efficiently modify your policy key.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "GoNqKHV8VesuNxoGm8F4a",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/updatePolicyKey",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\r\n    \"dbId\": 379291,\r\n    \"userCreate\": \"admin\",\r\n    \"key\": \"ls\",\r\n    \"description\": \"list\",\r\n    \"type\": \"WHITE\",\r\n    \"deviceTypes\": [\r\n        \"linux\"\r\n    ]\r\n}\r\n",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Update Policy Key",
        "jsonExample": "{\n    \"dbId\": 379291,\n    \"userCreate\": \"admin\",\n    \"userUpdate\": \"admin\",\n    \"creationDate\": null,\n    \"lastUpdate\": 1581612114691,\n    \"key\": \"ls\",\n    \"description\": \"list\",\n    \"userBehaviorRate\": null,\n    \"type\": \"WHITE\",\n    \"deviceTypes\": [\n        \"linux\"\n    ],\n    \"taskName\": null,\n    \"xmlContent\": null\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This method updates an existing policy key and its features. ",
    "examples": {
      "languages": [
        {
          "id": "Rmhg0uW5hOmqrlK-VRCzM",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/policy/updatePolicyKey \\\n     --header 'accept: application/json'"
        },
        {
          "id": "BISWmmn92CoyWq-zPoiKI",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/policy/updatePolicyKey\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "YbWq7U_OM2R5qVUA1rICR",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/updatePolicyKey\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ikfqz1YlPrYY1Cbcab0mc",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/updatePolicyKey\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Rmhg0uW5hOmqrlK-VRCzM"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n    \"dbId\": 379291,\n    \"userCreate\": \"admin\",\n    \"userUpdate\": \"admin\",\n    \"creationDate\": null,\n    \"lastUpdate\": 1581612114691,\n    \"key\": \"ls\",\n    \"description\": \"list\",\n    \"userBehaviorRate\": null,\n    \"type\": \"WHITE\",\n    \"deviceTypes\": [\n        \"linux\"\n    ],\n    \"taskName\": null,\n    \"xmlContent\": null\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}