Delete a device
DELETE/devices/{deviceId}
Base URL: https://api.tinkermode.com
Description
Delete (or "Un-provision") the device with the specified ID. The actual process depends on how the project is set up.
Devices are Pre-provisioned
If the project was configured to pre-provision all its devices, deleting a device simply means removing the device from its current home. The device can be claimed by another home in the future, and the device ID and device API key remain valid.
Devices are Provisioned on Demand
If the project was configured to allow On-Demand Device Provisioning, deleting a device means removing the device from its home and erasing the device from the system permanently. The device ID and device API key will become invalid.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the key of a user or service account with permission to delete the device, a project API key, or the device API key.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceId | integer | Yes | Device ID |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
hardDelete | boolean | No | This option is only available when the project is set up to pre-provision devices. If true, the device is deleted from the system permanently. To use this parameter, the request must be made using the API the key of a user with permission to delete project devices, or a project API key with "Admin" privileges. |
Responses
204 Successfully deleted a single device. There is no return body.
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
404 The required device does not exist or is not accessible.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
409 The device cannot be deleted because it is being used by another part of the system.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |