Bulk delete devices
DELETE
/api/v1/groups/devices
const url = 'http://localhost:3000/api/v1/groups/devices';const options = { method: 'DELETE', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"labelSelector":{"environment":"development","status":"deprecated"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url http://localhost:3000/api/v1/groups/devices \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "labelSelector": { "environment": "development", "status": "deprecated" } }'Soft deletes devices matching a selector.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
labelSelector
required
Label selector to match devices for deletion
object
key
additional properties
string
Example
{ "environment": "development", "status": "deprecated"}Responses
Section titled “ Responses ”Devices deleted successfully
Media type application/json
object
deleted
required
Number of devices deleted
number
deviceIds
required
IDs of deleted devices
Array<string>
Example
{ "deleted": 5, "deviceIds": [ "550e8400-e29b-41d4-a716-446655440000" ]}Bad Request
Unauthorized
Forbidden — caller lacks required permission