---
title: Save/Update Device Group Properties
slug: single-connect-api-3-0-3/saveupdate-device-group-properties
description: Learn how to effectively make POST requests to save or update device group properties with the help of our comprehensive code example. This document highlights the usage of curl, ensuring you have a clear understanding of the correct implementation. Optim
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "S589gK7GoaBIvBtsHZ6bb",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties",
    "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    \"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}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "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}"
      }
    ],
    "contentType": "application/json",
    "description": "This method allows saving a new property on device groups or updating existing property information on device groups.",
    "examples": {
      "languages": [
        {
          "id": "opr8H6ojf6NqfFJEwdpdW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties \\\n     --header 'accept: application/json'"
        },
        {
          "id": "mz8b-nl7IyPA3Hy5EXnsF",
          "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/discovery/saveOrUpdateDeviceGroupProperties\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "xTPF8lmWRbq2xg20MSTZ9",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\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\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "RtFvmZtX9geGq1-h0QzxF",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/saveOrUpdateDeviceGroupProperties\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "opr8H6ojf6NqfFJEwdpdW"
    },
    "results": {
      "languages": [
        {
          "id": "w-Lzcw707kLqdpbSWdniO",
          "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": "w-Lzcw707kLqdpbSWdniO"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}