---
updatedAt: 2026-05-06T15:26:01.000Z
agentTools:
  projectIndex: https://docs.ubidots.com/llms.txt
---

# Remove Device from Device Group

This endpoint removes one or more devices from a specific Device Group.

## Request

To remove one or more Devices from a Device Group, make a POST request to the following URL:

| HTTP Method | URL                                                                                              |
| :---------- | :----------------------------------------------------------------------------------------------- |
| POST        | `https://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>/_/remove_devices/` |

## Path Parameters

| Parameter             | Type   | Description                                                          |
| :-------------------- | :----- | :------------------------------------------------------------------- |
| \<device\_group\_key> | String | The id or label of the Device Group, label should use the prefix `~` |

## Query Parameters

| Parameter | Type   | Use            | Description                                                       |
| :-------- | :----- | :------------- | :---------------------------------------------------------------- |
| token     | String | Authentication | Authentication Token can optionally be sent as a query parameter. |

## Header

| Parameter     | Required? | Description                                                  |
| :------------ | :-------- | :----------------------------------------------------------- |
| X-Auth-Header | Yes       | [Authentication Token](https://docs.ubidots.com/reference/authentication) of account |

> 📘 Remove all Devices at once
>
> To remove all Devices from the Device Group in a single call, use the [Assign Device to Device Group](https://docs.ubidots.com/reference/assign-device-to-device-group) endpoint with an empty array `[]` in the body and `clear=true` as a query parameter.

```curl cURL (Request)
$ curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>/_/remove_devices/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '[
  "5e1cc1e789f9bd33017e05f4",
  "~test-device",
  {"id": "5e1cc1e789f9bd335550d4c2b492"}
]'
```

```json 200 OK
{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}
```
```json 400 Bad Request
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
```
```json 401 Unauthorized
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
```

## Response

Returns an object with an empty `results` array.