---
title: Delete Devices
slug: single-connect-api-3-0-3/delete-devices
description: Learn how to use the cURL command for making DELETE requests to delete devices via a specific URL. This detailed document includes code examples, highlighting the necessary JSON format, mandatory request headers, and request body for successful execution.
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "QChkAAnWWzUmlSLSDkz3F",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/deleteDevices",
    "method": "DELETE",
    "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\n {\n \t\"dbId\": \"2862774\",\n    \"id\": \"f7452550-a290-47ed-b6fc-3b0f525dfc31\",\n    \"managementIp\": \"10.20.40.248\"\n    }\n]",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "deleteDevicesbyDbID",
        "jsonExample": "{\n    \"DeviceDbid: 391662\": \"Success\"\n}"
      },
      {
        "statusCode": "200",
        "description": "deleteDevicesbyDeviceID",
        "jsonExample": "{\n    \"Device ID: : 5f92c11b-1d41-4c86-8ee2-f28dccc7f4c9\": \"Success\"\n}"
      },
      {
        "statusCode": "200",
        "description": "deleteDevicesbyDeviceIP",
        "jsonExample": "{\n    \"Management IP: 10.20.40.248\": \"Success\"\n}"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method deletes devices.</p>\n<p>Mandatory fields in request body to delete devices:\n\"id\":</p>\n<p>Many devices can be deleted in one request as bulk delete.</p>",
    "examples": {
      "languages": [
        {
          "id": "1tbTcwoNLUfgdWdVfjibW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/discovery/deleteDevices \\\n     --header 'accept: application/json'"
        },
        {
          "id": "AuSUiELvb29rxv82S5W0A",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/deleteDevices\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Yv98kmY1W3IQuwh1A_cWX",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/deleteDevices\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "6H4L5gI2auxGTQ8SINVss",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/deleteDevices\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "1tbTcwoNLUfgdWdVfjibW"
    },
    "results": {
      "languages": [
        {
          "id": "AnPaeXYAT6aRe1Vaore3Y",
          "language": "200",
          "code": "{\n    \"DeviceDbid: 391662\": \"Success\"\n}"
        },
        {
          "id": "SyfP8CeUgkNLD5spDZ9rV",
          "language": "200",
          "code": "{\n    \"Device ID: : 5f92c11b-1d41-4c86-8ee2-f28dccc7f4c9\": \"Success\"\n}"
        },
        {
          "id": "VLhlfqQTzJmv0bDiFKLO1",
          "language": "200",
          "code": "{\n    \"Management IP: 10.20.40.248\": \"Success\"\n}"
        }
      ],
      "selectedLanguageId": "AnPaeXYAT6aRe1Vaore3Y"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}