---
title: Update Policy Group
slug: single-connect-api-3-2-0/update-policy-group
description: Learn how to use cURL to update a policy key group in a REST API with this comprehensive code example. Discover the essential headers and data required for a successful POST request, allowing you to seamlessly update policy key groups.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "BPT6FvcnlepaWBoRprKYN",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/updatePolicyKeyGroup",
    "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\": 406596,   \r\n        \"name\": \"p_updated\",\r\n    \t\"description\": \"p1\",\r\n        \"policyKeys\": [],\r\n        \"httpPolicies\": [],\r\n        \"maskingPolicies\": [],\r\n        \"timeRestrictions\": [],\r\n        \"sendEmail\": false,\r\n        \"sendSnmp\": false,\r\n        \"action\": \"GENERATE_ERROR\",\r\n        \"confirmationText\": null,\r\n        \"operationMode\": \"OPERATION\"\r\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Update Policy Group",
        "jsonExample": "{\n    \"dbId\": 406596,\n    \"name\": \"p_updated\",\n    \"description\": \"p1\",\n    \"policies\": [],\n    \"policyKeys\": [],\n    \"httpPolicies\": [],\n    \"maskingPolicies\": [],\n    \"timeRestrictions\": [],\n    \"realms\": null,\n    \"sendEmail\": false,\n    \"sendSnmp\": false,\n    \"action\": \"GENERATE_ERROR\",\n    \"confirmationText\": null,\n    \"operationMode\": \"OPERATION\",\n    \"userCreate\": null,\n    \"userUpdate\": null,\n    \"creationDate\": null,\n    \"lastUpdate\": null\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This method updates an existing policy group.\n\ndbId is the mandatory field to update the related policy group. ",
    "examples": {
      "languages": [
        {
          "id": "WKSAOyzcuOI5W14A9OXzW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/policy/updatePolicyKeyGroup \\\n     --header 'accept: application/json'"
        },
        {
          "id": "gzUboe61IE8Gs7LN_OzYP",
          "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/updatePolicyKeyGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qXiNpTcXOkNrGMbH1-qdd",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/updatePolicyKeyGroup\")\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": "_wMs66fufJoAYOqBwqzka",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/updatePolicyKeyGroup\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "WKSAOyzcuOI5W14A9OXzW"
    },
    "results": {
      "languages": [
        {
          "id": "5uGaBrIPpRjFBdttgiVbE",
          "language": "200",
          "code": "{\n    \"dbId\": 406596,\n    \"name\": \"p_updated\",\n    \"description\": \"p1\",\n    \"policies\": [],\n    \"policyKeys\": [],\n    \"httpPolicies\": [],\n    \"maskingPolicies\": [],\n    \"timeRestrictions\": [],\n    \"realms\": null,\n    \"sendEmail\": false,\n    \"sendSnmp\": false,\n    \"action\": \"GENERATE_ERROR\",\n    \"confirmationText\": null,\n    \"operationMode\": \"OPERATION\",\n    \"userCreate\": null,\n    \"userUpdate\": null,\n    \"creationDate\": null,\n    \"lastUpdate\": null\n}"
        }
      ],
      "selectedLanguageId": "5uGaBrIPpRjFBdttgiVbE"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}