Remove Device from Device Group

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

Request

To remove one or more Devices from a Device Group please 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.

Body Parameters

Parameter

Type

Required?

Default Value

Description

devices

String Array

Yes

N/A (required)

List of device Ids or device labels that need to be assigned to device group

Header

Parameter

Required?

Description

X-Auth-Header

Yes

Authentication Token of account

📘

Remove all Devices at once

In order to remove all Devices from the Device Group in a single call, it is also possible to use the Assign Device to Device Group with an empty array [] in the body parameter devices.

$ 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 '{
    "devices":[
  "5e1cc1e789f9bd33017e05f4",
  "test",
  {"id": "5e1cc1e789f9bd33babababa"}
]
}'
{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}

Response

Returns an Object with an empty results array.