---
title: Save/Update Device Group Properties
slug: kronpam-api-collection-350/saveupdate-device-group-properties
docTags: 
createdAt: 2024-07-22T09:58:47.221Z
---

{
  "id": "AmK1ShDnbgS_7lXFbNaz4",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties",
    "name": "",
    "description": "This method allows saving a new property on device groups or updating existing property information on device groups.",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/json",
          "value": "application/json",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\n    \"dbId\": 620393,\n    \"id\": \"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\",\n  \n  \n    \"properties\": {\n        \"globalUsername\": \"root\",\n        \"globalSecretKey\": \"test\",\n        \"globalPassword\": \"123\",\n        \"discoverySources\": null\n    },\n    \"children\": [],\n    \"devices\": null,\n    \"rootGroupId\": null,\n    \"showInDeviceTree\": true,\n    \"useAsRoleGroup\": true,\n    \"discoverySources\": null,\n    \"readOnly\": false\n}",
          "value": "{\n    \"dbId\": 620393,\n    \"id\": \"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\",\n  \n  \n    \"properties\": {\n        \"globalUsername\": \"root\",\n        \"globalSecretKey\": \"test\",\n        \"globalPassword\": \"123\",\n        \"discoverySources\": null\n    },\n    \"children\": [],\n    \"devices\": null,\n    \"rootGroupId\": null,\n    \"showInDeviceTree\": true,\n    \"useAsRoleGroup\": true,\n    \"discoverySources\": null,\n    \"readOnly\": false\n}",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "saveOrUpdateDeviceGroupProperties",
        "jsonExample": "{\n    \"dbId\": 303880,\n    \"id\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"name\": \"SSH DG2\",\n    \"description\": null,\n    \"parentGroupId\": null,\n    \"ifaceOperationCheck\": false,\n    \"timeTolerance\": null,\n    \"realms\": [\n        304366,\n        3478516\n    ],\n    \"deviceIds\": [],\n    \"properties\": {\n        \"globalUsername\": \"root\",\n        \"globalSecretKey\": \"M67taQwHRBH6wJ1gDU5c2g==\",\n        \"globalPassword\": \"jNJ6k+7ic9Qcr3wXFIgmZA==\"\n    },\n    \"children\": null,\n    \"devices\": null,\n    \"rootGroupId\": null,\n    \"globalUsername\": \"root\",\n    \"globalPassword\": \"jNJ6k+7ic9Qcr3wXFIgmZA==\",\n    \"showInDeviceTree\": true,\n    \"useAsRoleGroup\": true,\n    \"discoverySources\": null,\n    \"readOnly\": false\n}"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "EfAKsMar-pEfmGIuYAf_f",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"{\\n    \\\"dbId\\\": 620393,\\n    \\\"id\\\": \\\"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\\\",\\n  \\n  \\n    \\\"properties\\\": {\\n        \\\"globalUsername\\\": \\\"root\\\",\\n        \\\"globalSecretKey\\\": \\\"test\\\",\\n        \\\"globalPassword\\\": \\\"123\\\",\\n        \\\"discoverySources\\\": null\\n    },\\n    \\\"children\\\": [],\\n    \\\"devices\\\": null,\\n    \\\"rootGroupId\\\": null,\\n    \\\"showInDeviceTree\\\": true,\\n    \\\"useAsRoleGroup\\\": true,\\n    \\\"discoverySources\\\": null,\\n    \\\"readOnly\\\": false\\n}\"'"
        },
        {
          "id": "-U9c-MEIqttkCHpLYarrc",
          "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 raw = JSON.stringify(\"{\\n    \\\"dbId\\\": 620393,\\n    \\\"id\\\": \\\"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\\\",\\n  \\n  \\n    \\\"properties\\\": {\\n        \\\"globalUsername\\\": \\\"root\\\",\\n        \\\"globalSecretKey\\\": \\\"test\\\",\\n        \\\"globalPassword\\\": \\\"123\\\",\\n        \\\"discoverySources\\\": null\\n    },\\n    \\\"children\\\": [],\\n    \\\"devices\\\": null,\\n    \\\"rootGroupId\\\": null,\\n    \\\"showInDeviceTree\\\": true,\\n    \\\"useAsRoleGroup\\\": true,\\n    \\\"discoverySources\\\": null,\\n    \\\"readOnly\\\": false\\n}\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "JdsEiEc5pQxONq8NsHX5h",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"{\\n    \\\"dbId\\\": 620393,\\n    \\\"id\\\": \\\"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\\\",\\n  \\n  \\n    \\\"properties\\\": {\\n        \\\"globalUsername\\\": \\\"root\\\",\\n        \\\"globalSecretKey\\\": \\\"test\\\",\\n        \\\"globalPassword\\\": \\\"123\\\",\\n        \\\"discoverySources\\\": null\\n    },\\n    \\\"children\\\": [],\\n    \\\"devices\\\": null,\\n    \\\"rootGroupId\\\": null,\\n    \\\"showInDeviceTree\\\": true,\\n    \\\"useAsRoleGroup\\\": true,\\n    \\\"discoverySources\\\": null,\\n    \\\"readOnly\\\": false\\n}\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9tc6f2O0yE1KDcJKNkqGg",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties\"\n\npayload = json.dumps(\"{\\n    \\\"dbId\\\": 620393,\\n    \\\"id\\\": \\\"43eb3141-7dcf-47f8-bc68-c21de3d1b45d\\\",\\n  \\n  \\n    \\\"properties\\\": {\\n        \\\"globalUsername\\\": \\\"root\\\",\\n        \\\"globalSecretKey\\\": \\\"test\\\",\\n        \\\"globalPassword\\\": \\\"123\\\",\\n        \\\"discoverySources\\\": null\\n    },\\n    \\\"children\\\": [],\\n    \\\"devices\\\": null,\\n    \\\"rootGroupId\\\": null,\\n    \\\"showInDeviceTree\\\": true,\\n    \\\"useAsRoleGroup\\\": true,\\n    \\\"discoverySources\\\": null,\\n    \\\"readOnly\\\": false\\n}\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "EfAKsMar-pEfmGIuYAf_f"
    },
    "results": {
      "languages": [
        {
          "id": "P5kjieprjlefvc9IV8uyT",
          "language": "200",
          "code": "{\n    \"dbId\": 303880,\n    \"id\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"name\": \"SSH DG2\",\n    \"description\": null,\n    \"parentGroupId\": null,\n    \"ifaceOperationCheck\": false,\n    \"timeTolerance\": null,\n    \"realms\": [\n        304366,\n        3478516\n    ],\n    \"deviceIds\": [],\n    \"properties\": {\n        \"globalUsername\": \"root\",\n        \"globalSecretKey\": \"M67taQwHRBH6wJ1gDU5c2g==\",\n        \"globalPassword\": \"jNJ6k+7ic9Qcr3wXFIgmZA==\"\n    },\n    \"children\": null,\n    \"devices\": null,\n    \"rootGroupId\": null,\n    \"globalUsername\": \"root\",\n    \"globalPassword\": \"jNJ6k+7ic9Qcr3wXFIgmZA==\",\n    \"showInDeviceTree\": true,\n    \"useAsRoleGroup\": true,\n    \"discoverySources\": null,\n    \"readOnly\": false\n}"
        }
      ],
      "selectedLanguageId": "P5kjieprjlefvc9IV8uyT"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}