---
title: Delete Devices
slug: single-connect-api-3-2-0/delete-devices
description: Learn how to use the powerful curl command to perform DELETE requests with ease. This code example demonstrates the correct syntax and includes the necessary headers and body content for making a DELETE request to a specific URL. Expand your knowledge and
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "iL6igVuZCJ1v5Xgapzril",
  "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": "sGs98qjB2QPfkCQ3z3pYK",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/discovery/deleteDevices \\\n     --header 'accept: application/json'"
        },
        {
          "id": "kCJ7zbI_Z3CagSUknw8vA",
          "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": "mmBQp6Ry3Yr3kj1r06WPp",
          "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": "UWx5cNYe4AI4bjJF7rs0u",
          "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": "sGs98qjB2QPfkCQ3z3pYK"
    },
    "results": {
      "languages": [
        {
          "id": "1Sk_3m-lCN5XUZJYR5erW",
          "language": "200",
          "code": "{\n    \"DeviceDbid: 391662\": \"Success\"\n}"
        },
        {
          "id": "NV8WzmSIeX39bgoG890Re",
          "language": "200",
          "code": "{\n    \"Device ID: : 5f92c11b-1d41-4c86-8ee2-f28dccc7f4c9\": \"Success\"\n}"
        },
        {
          "id": "tCZPmxLBML2baFpPPWzCo",
          "language": "200",
          "code": "{\n    \"Management IP: 10.20.40.248\": \"Success\"\n}"
        }
      ],
      "selectedLanguageId": "1Sk_3m-lCN5XUZJYR5erW"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}