Skip to main content

Disconnect Device by User ID and Device ID API

POST /disconnectByUserIdAndDeviceId

Description

This API endpoint allows an admin to disconnect a device from a specific user's account using the user's ID and the device's identification details. This operation removes the association between the device and the user's account within the platform.

Request Body

The request utilizes GraphQL to perform the disconnectByUserIdAndDeviceId mutation.

Mutation:

mutation disconnectByUserIdAndDeviceId ($userId: Int!, $deviceIdInput: DeviceIdInput) {
disconnectByUserIdAndDeviceId (userId: $userId, deviceIdInput: $deviceIdInput)
}

Variables:

{
"userId": 0,
"deviceIdInput": {
"uuid": "<Device_UUID>",
"serial": "<Device_Serial_Number>",
"name": "<Device_Name>"
}
}
  • userId (Int): The unique identifier of the user from whom the device will be disconnected.
  • deviceIdInput (DeviceIdInput Object): An object containing the device's identification details.
    • uuid (String): The universally unique identifier (UUID) of the device.
    • serial (String): The serial number of the device.
    • name (String): The name of the device.

Response:

  • Success (200 OK):

    • If the device disconnection is successful, the response will confirm that the device has been disconnected from the user's account.
    {
    "data": {
    "disconnectByUserIdAndDeviceId": true
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with disconnecting the device, the response will include an appropriate error message and status code.

Note:

Ensure that the userId corresponds to an existing user within the platform and that the deviceIdInput object contains valid and correctly formatted data. This API should be used by admins with the necessary permissions to manage device associations for users.