Release Device

Restriction: This API endpoint is not supported in the public cloud.
Restriction: This API endpoint is not supported in the Free Trial cloud.

Forcefully releases the device specified by <deviceId>. The device is either allocated to the user or the user is an administrator.

Users can only release devices accessible by their roles.

URL

Copy
http://<your-cloud>.app.perfectomobile.com/api/v1/device-management/devices/<deviceId>/release

Method

Patch

For information on a previous version of this endpoint, see Release Device | Legacy.

Header parameters

Name

Description

Perfecto-Authorization

The Perfecto security token. For more information, see Generate security tokens.

Request parameters

Name

Type

Default

Description

admin

boolean

false

Set to true to allow allow users with administrator credentials to release a device that is allocated to a user that the admin administers.

Success response

Code: 200

Copy
Success response format
{
    "status": "Success"
}

Error response

Copy
Error response format
[
    {
        "userMessage":"ERROR_MESSAGE",
        "developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
    }
]

where:

  • userMessage is the error message to be shown.

  • developerMessage is a value that you can send to Perfecto Support to check errors if further investigation is required.

An error is returned in the following cases:

  • The device is not found.
  • The device is not accessible to the user with the assigned roles.
  • The device is not connected.
  • The device is not in use.
  • The device is not allocated to the user (in user mode).
  • The admin is not a user administrator for the user (in admin mode).

Sample error responses

Copy

A wrong securityToken is passed in the request (Unauthorized Request Code - 401)

[
    {
        "userMessage": "Unable to authenticate bearer token",
        "developerMessage": "Unable to authenticate bearer token"
    }
]
Copy

The device is not in use (Bad Request Code - 400)

[
    {
        "userMessage": "Failed to release device - Can't release device <deviceId> - device is not in use",
        "developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
    }
]
Copy

The device is not found (Bad Request Code - 400)

[
    {
        "userMessage": "Failed to release device - Device not found - <deviceId>",
        "developerMessage": "1-63dc7eef-7b16bbe46b71b89f599547dc"
    }
]