---
title: Update Device Group Ip Pattern
slug: single-connect-api-3-0-3/update-device-group-ip-pattern
description: Learn how to update a device group IP pattern with a POST request using curl. This document provides a code example, including the required headers for JSON data, and guides you on forming the request body as a string. Get step-by-step instructions for ma
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "d5oW6vuITeEAdnlUKUMy-",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupIpPattern",
    "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\": 3484693,\n      \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n      \"interfaceName\": null,\n      \"action\": \"DENY\",\n      \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.([1-9][0-9]|1([0-1][0-9]|2[0-5]))$\"\n    }\n\n",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "updateDeviceGroupIpPattern",
        "jsonExample": "{\n    \"dbId\": 3484693,\n    \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"interfaceName\": null,\n    \"action\": \"DENY\",\n    \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.([1-9][0-9]|1([0-1][0-9]|2[0-5]))$\"\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This method updates Ip  Pattern of the device group.",
    "examples": {
      "languages": [
        {
          "id": "uMM6F9TAKb-nOEVYljfs3",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupIpPattern \\\n     --header 'accept: application/json'"
        },
        {
          "id": "8FHzdpHw80bWMa-uJP9f5",
          "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/updateDeviceGroupIpPattern\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Lj1T_tlxqk7uPKLD839w-",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupIpPattern\")\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": "tjeBrza-jxE6QSuLARPc0",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/updateDeviceGroupIpPattern\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "uMM6F9TAKb-nOEVYljfs3"
    },
    "results": {
      "languages": [
        {
          "id": "YYrXk24pNy0FZnKyiBNCt",
          "language": "200",
          "code": "{\n    \"dbId\": 3484693,\n    \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n    \"interfaceName\": null,\n    \"action\": \"DENY\",\n    \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.([1-9][0-9]|1([0-1][0-9]|2[0-5]))$\"\n}"
        }
      ],
      "selectedLanguageId": "YYrXk24pNy0FZnKyiBNCt"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}