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 MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/device_groups/<device_group_key>/_/remove_devices/

Path Parameters

ParameterTypeDescription
<device_group_key>StringThe id or label of the Device Group, label should use the prefix ~

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Header

ParameterRequired?Description
X-Auth-HeaderYesAuthentication 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 endpoint with an empty array [] in the body and clear=true as a query parameter.

$ 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"}
]'
{
    "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.