---
title: Update Device Group Subnet
slug: single-connect-api-3-2-0/update-device-group-subnet
description: Learn how to update a device group subnet using the curl command in this comprehensive code example. Find the step-by-step instructions, URL, headers, and body parameters required to execute a successful POST request and efficiently manage your device gro
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "ATa2SCQ49ugYRRqf-WKkY",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupSubnet",
    "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\": 3483567,\n    \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"subnetIp\": \"10.30.40.1\",\n    \"mask\": null,\n    \"cidr\": 24,\n    \"interfaceName\": \"null\"\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "updateDeviceGroupSubnet",
        "jsonExample": "{\n    \"dbId\": 3483567,\n    \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"subnetIp\": \"10.30.40.1\",\n    \"mask\": null,\n    \"cidr\": 24,\n    \"firstIp\": 169748481,\n    \"lastIp\": 169748736,\n    \"interfaceName\": \"null\"\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This method updates subnet info of the device group.\n\ndbId is mandatory field.\ndbID info can be get from \"getDeviceGroupSubnets\" api result",
    "examples": {
      "languages": [
        {
          "id": "ZXIw7UR1Sr4SW4unCyoQ-",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupSubnet \\\n     --header 'accept: application/json'"
        },
        {
          "id": "I5pCa_zatMTunXoMpEhRo",
          "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/updateDeviceGroupSubnet\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "M8mWE-oMlTpUbQHB1cqH3",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupSubnet\")\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": "eR38LUKZ2VeUPj6zVf9my",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupSubnet\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "ZXIw7UR1Sr4SW4unCyoQ-"
    },
    "results": {
      "languages": [
        {
          "id": "mmSBVuT9EQeehPDAQ2Y5-",
          "language": "200",
          "code": "{\n    \"dbId\": 3483567,\n    \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"subnetIp\": \"10.30.40.1\",\n    \"mask\": null,\n    \"cidr\": 24,\n    \"firstIp\": 169748481,\n    \"lastIp\": 169748736,\n    \"interfaceName\": \"null\"\n}"
        }
      ],
      "selectedLanguageId": "mmSBVuT9EQeehPDAQ2Y5-"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}