Navigation

Detach a device

Attach a device to a user.

Parameters


client_id string REQUIRED

The client ID of your project's API key.


user string REQUIRED

The ID of the user you want the device to be linked to.


device string REQUIRED

The ID of the device. This is normally returned in the response by the attach function. If you do not know the ID of the device, you can call the attach function again and get the device ID from the response, then use it in this function.


Returns


Returns device and user access state information.
POST /v2/device/:id/detach
import { attach } from 'rupt';

await Rupt.detach({
  client_id: `CLIENT_ID`,
  user: `USER_ID`,
  device: `DEVICE_ID`,
});
Response
{ 
  "success": true,
  "attached_devices": 3,
  "device_id": "6323dadac7c49192e9154563",
  "default_device_limit": 2,
  "block_over_usage": false,
}