---
title: Delete Policy Realm
slug: single-connect-api-3-0-3/delete-policy-realm
description: Learn how to delete a policy realm using a REST API with this comprehensive code example. Discover the CURL command, complete with headers and body content, to effortlessly remove a policy realm.
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "s9T6pYCGBSP_mdY7_3R7E",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/deletePolicyRealm",
    "method": "DELETE",
    "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}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Delete Policy Realm",
        "jsonExample": "Success"
      }
    ],
    "contentType": "application/json",
    "description": "This method deletes an existing policy realms whose DBIDs are sent in request body.\nThis method can be used in bulk operations by adding many DBIDs of Policy Realms to delete all of them.\ndbId is the mandatory field in request body.",
    "examples": {
      "languages": [
        {
          "id": "oyPTJCPTFCsecMZVRM01a",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/policy/deletePolicyRealm \\\n     --header 'accept: application/json'"
        },
        {
          "id": "EvIAiet9fSfqLl2HuMlQI",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/policy/deletePolicyRealm\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "yTxwX92pCp0EoIk9cdOaU",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/deletePolicyRealm\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "woySMWS-7TwSJKv623DeN",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/deletePolicyRealm\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "oyPTJCPTFCsecMZVRM01a"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "Success"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}