---
title: Delete Device Realms
slug: single-connect-api-3-0-3/delete-device-realms
description: Learn how to delete device realms in a REST API using cURL with this helpful code example. The comprehensive guide provides a step-by-step tutorial, including the necessary URL, headers, and raw JSON data for the DELETE request. Improve your knowledge of 
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "rfgGDcWg2zU6pPEZtE-pe",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/discovery/deleteDeviceRealms",
    "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\t   \"dbId\":3478516,       \n       \"name\": \"TEST_DeviceRealm\"\n        \n    }\n]",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "deleteDeviceRealms",
        "jsonExample": "{\n    \"TEST_DeviceRealm\": \"Success\"\n}"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method deletes a current device realm to Single Connect.\r\nMandatory fields:\r\n\"dbId\"</p>",
    "examples": {
      "languages": [
        {
          "id": "sx1dQjTH5iHmOlyG1bcUv",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url {{url}}/aioc-rest-web/rest/discovery/deleteDeviceRealms \\\n     --header 'accept: application/json'"
        },
        {
          "id": "GiPKOsEAo2hHxdqApCupL",
          "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/deleteDeviceRealms\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "AK4WwnLuMCbs1QzG7UUaG",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/deleteDeviceRealms\")\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": "KXVpx5lh77yGnZAnReetd",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/deleteDeviceRealms\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "sx1dQjTH5iHmOlyG1bcUv"
    },
    "results": {
      "languages": [
        {
          "id": "MAUxwhzmyFl3zJqf3tYky",
          "language": "200",
          "code": "{\n    \"TEST_DeviceRealm\": \"Success\"\n}"
        }
      ],
      "selectedLanguageId": "MAUxwhzmyFl3zJqf3tYky"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}