---
title: Search Policy Group
slug: single-connect-api-3-0-3/search-policy-group
description: Learn how to make a POST request to search for a policy group using Curl with this code example. Discover the step-by-step process, including the specific URL and request data required, to efficiently navigate policy group searches. Boost your coding skil
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "E9xfkWOw0aZ4n9iMRcITO",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/policy/searchPolicyGroup",
    "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": "{\n\t\"name\": \"PG_linux\"\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Search Policy Group",
        "jsonExample": "[\n    {\n        \"dbId\": 376256,\n        \"name\": \"PG_linux\",\n        \"description\": null,\n        \"policies\": [\n            {\n                \"dbId\": 376251,\n                \"userCreate\": \"admin\",\n                \"userUpdate\": null,\n                \"creationDate\": 1581605373075,\n                \"lastUpdate\": null,\n                \"key\": \".*\",\n                \"description\": null,\n                \"userBehaviorRate\": null,\n                \"type\": \"WHITE\",\n                \"deviceTypes\": [\n                    \"linux\"\n                ],\n                \"taskName\": null,\n                \"xmlContent\": null\n            }\n        ],\n        \"policyKeys\": [\n            {\n                \"dbId\": 376251,\n                \"userCreate\": \"admin\",\n                \"userUpdate\": null,\n                \"creationDate\": 1581605373075,\n                \"lastUpdate\": null,\n                \"key\": \".*\",\n                \"description\": null,\n                \"userBehaviorRate\": null,\n                \"type\": \"WHITE\",\n                \"deviceTypes\": [\n                    \"linux\"\n                ],\n                \"taskName\": null,\n                \"xmlContent\": null\n            }\n        ],\n        \"httpPolicies\": [],\n        \"maskingPolicies\": [],\n        \"timeRestrictions\": [],\n        \"realms\": [\n            376291\n        ],\n        \"sendEmail\": false,\n        \"sendSnmp\": false,\n        \"action\": \"GENERATE_ERROR\",\n        \"confirmationText\": null,\n        \"operationMode\": \"OPERATION\",\n        \"userCreate\": \"admin\",\n        \"userUpdate\": null,\n        \"creationDate\": 1581605384541,\n        \"lastUpdate\": null\n    }\n]"
      }
    ],
    "contentType": "application/json",
    "description": "This method lists the policy group features if the name of the related policy group is sent in request body.",
    "examples": {
      "languages": [
        {
          "id": "vaJpVepVOqOosfSV7d32Y",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/policy/searchPolicyGroup \\\n     --header 'accept: application/json'"
        },
        {
          "id": "zMFb9Sy282v9FqWD__YxA",
          "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/searchPolicyGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Kwy879_mTOwA8y0MGN-zD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/policy/searchPolicyGroup\")\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": "DRnzDN5z2EzmhQ5xWqHQW",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/policy/searchPolicyGroup\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "vaJpVepVOqOosfSV7d32Y"
    },
    "results": {
      "languages": [
        {
          "id": "Oz1W6DKP1FRX7gXZjCaJz",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 376256,\n        \"name\": \"PG_linux\",\n        \"description\": null,\n        \"policies\": [\n            {\n                \"dbId\": 376251,\n                \"userCreate\": \"admin\",\n                \"userUpdate\": null,\n                \"creationDate\": 1581605373075,\n                \"lastUpdate\": null,\n                \"key\": \".*\",\n                \"description\": null,\n                \"userBehaviorRate\": null,\n                \"type\": \"WHITE\",\n                \"deviceTypes\": [\n                    \"linux\"\n                ],\n                \"taskName\": null,\n                \"xmlContent\": null\n            }\n        ],\n        \"policyKeys\": [\n            {\n                \"dbId\": 376251,\n                \"userCreate\": \"admin\",\n                \"userUpdate\": null,\n                \"creationDate\": 1581605373075,\n                \"lastUpdate\": null,\n                \"key\": \".*\",\n                \"description\": null,\n                \"userBehaviorRate\": null,\n                \"type\": \"WHITE\",\n                \"deviceTypes\": [\n                    \"linux\"\n                ],\n                \"taskName\": null,\n                \"xmlContent\": null\n            }\n        ],\n        \"httpPolicies\": [],\n        \"maskingPolicies\": [],\n        \"timeRestrictions\": [],\n        \"realms\": [\n            376291\n        ],\n        \"sendEmail\": false,\n        \"sendSnmp\": false,\n        \"action\": \"GENERATE_ERROR\",\n        \"confirmationText\": null,\n        \"operationMode\": \"OPERATION\",\n        \"userCreate\": \"admin\",\n        \"userUpdate\": null,\n        \"creationDate\": 1581605384541,\n        \"lastUpdate\": null\n    }\n]"
        }
      ],
      "selectedLanguageId": "Oz1W6DKP1FRX7gXZjCaJz"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}