---
title: Update Policy Realm
slug: single-connect-api-3-2-0/update-policy-realm
description: Learn how to update a policy realm in a web service using CURL with this helpful code example. Get detailed instructions on making a POST request, including the required headers and data to include.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "-yhDoRM1fdNIkLT0MP6zu",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/updatePolicyRealm",
    "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\":\"378556\",     \r\n    \"name\": \"realmAPI2\",\r\n    \"description\": \"realmUpdated\",\r\n    \"policyGroups\": [\r\n        {\"dbId\": 19934}\r\n    ],\r\n    \"deviceRealms\": [\r\n        {\"dbId\": 19894}\r\n    ]\r\n}\r\n",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Update Policy Realm",
        "jsonExample": "Success"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method updates an existing policy realm to change the properties, realms hieararchy etc.</p>\n<p>dbId in request body is mandatory field to update the related policy realm.</p>",
    "examples": {
      "languages": [
        {
          "id": "t8A8P4fSwii_qD1rKl9Gb",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/policy/updatePolicyRealm \\\n     --header 'accept: application/json'"
        },
        {
          "id": "7uj8BeZAkDKxMxadP4f7g",
          "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/updatePolicyRealm\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "a8NKqjLvumMSa1mq7C_ij",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/updatePolicyRealm\")\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": "PpomunMHW1o1mFerpd1M4",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/updatePolicyRealm\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "t8A8P4fSwii_qD1rKl9Gb"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "Success"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}