---
title: Get Device Groups by Phrase
slug: kron-pam-api-collection-381-patch3/get-device-groups-by-phrase
docTags: 
createdAt: 2026-10-21T06:07:16.182Z
---

{
  "id": "6HXkyAdKd5mqqbDSHogex",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>The <strong>Get Device Groups by Phrase</strong> method retrieves device groups based on a specific search phrase in the KRON PAM system.</p>\n<h4>Usage:</h4>\n<ul>\n<li>Enter the search phrase in the <code>\"\"PHRASE\"\"</code> field within the request URL.</li>\n</ul>\n<p>This method is used to find device groups that match the given search phrase, providing details such as the device group ID, name, associated realms, and other relevant information.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "x-xsrf-token",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Get Device Groups by Phrase",
        "jsonExample": "[\n    {\n        \"dbId\": 377038,\n        \"id\": \"e4442f9a-1144-4196-bb51-2aaee9405330\",\n        \"name\": \"SAPM device\",\n        \"description\": \"SAPM device\",\n        \"parentGroupId\": null,\n        \"parentGroupName\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            377043,\n            392562\n        ],\n        \"deviceIds\": [\n            377460\n        ],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"firstResult\": null,\n        \"maxResult\": null,\n        \"deviceCountInDb\": null,\n        \"label\": \"SAPM device (/)\",\n        \"fullPath\": \"/\",\n        \"showInDeviceTree\": true\n    }\n]"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "PleqbBylCfn41b4vN4BLQ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "YM6wyOw9dFW2u47N9L_Yt",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "-xP9466ytNDd7TOgckSKQ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Jz6hzFXPz0_IFDp6LzoCF",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupsBySearchPhrase/SAPM\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "PleqbBylCfn41b4vN4BLQ"
    },
    "results": {
      "languages": [
        {
          "id": "qvdpy3dYRLcpLKY_-UyD9",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 377038,\n        \"id\": \"e4442f9a-1144-4196-bb51-2aaee9405330\",\n        \"name\": \"SAPM device\",\n        \"description\": \"SAPM device\",\n        \"parentGroupId\": null,\n        \"parentGroupName\": null,\n        \"ifaceOperationCheck\": false,\n        \"timeTolerance\": null,\n        \"realms\": [\n            377043,\n            392562\n        ],\n        \"deviceIds\": [\n            377460\n        ],\n        \"properties\": {},\n        \"children\": null,\n        \"devices\": null,\n        \"firstResult\": null,\n        \"maxResult\": null,\n        \"deviceCountInDb\": null,\n        \"label\": \"SAPM device (/)\",\n        \"fullPath\": \"/\",\n        \"showInDeviceTree\": true\n    }\n]"
        }
      ],
      "selectedLanguageId": "qvdpy3dYRLcpLKY_-UyD9"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}