Deactivate Device API
POST /deactivateDevice
Description
This API endpoint allows an admin to deactivate a device associated with a specific user's account using the user's ID and the device's identification details. Deactivating a device will disable its access and functionalities within the platform.
Request Body
The request utilizes GraphQL to perform the deactivateDevice
mutation.
Mutation:
mutation deactivateDevice ($userId: Int!, $deviceIdInput: DeviceIdInput) {
deactivateDevice (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 whose device will be deactivated.
- 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 deactivation is successful, the response will confirm that the device has been deactivated.
{
"data": {
"deactivateDevice": true
}
} -
Error (4XX/5XX):
- If there is an issue with deactivating 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 statuses for users.