Deletes up to 100 specified devices from the account. You must deactivate service for the devices before you can delete them.
See also:
Deactivate Service for Devices
You must use this API method if you have deactivated a 4G device and want to use the SIM in a different device, or want to use the same device with a different SIM. Until you delete the device, the SIM and the device are still paired in the Verizon database and neither one can be reused.
NOTE: All historical records of the device are deleted when you delete the device. Be sure to retrieve any device history (usage history, connection history) that you might want before you delete the device.
POST https://thingspace.verizon.com/api/m2m/v1/devices/actions/delete
None.
The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.
Parameter Name | Data Type | Description |
---|---|---|
Authorization required |
string | HTTP Authorization bearer token. |
VZ-M2M-Token required |
string | A valid session token returned by POST /session/login. |
Content-Type required |
string | Must be application/json . |
The request body identifies the devices to delete.
Parameter Name | Data Type | Description |
---|---|---|
devicesToDelete required |
array of deviceIds | A list of up to 100 devices that you want to delete, specified by device identifier. You only need to provide one identifier per device. |
deviceIds
required |
array of objects | One object per device to be deleted. Each object must contain a kind and id element identifying the device. |
kind,
id required for devices |
string | The type and value of the device identifier.
|
accountName optional *Recommended |
string | The Verizon billing account that the device group belongs to. An account name is usually numeric, and must include any leading zeros. *By coding for the account number today, you prevent future code from breaking if you ever add a new sub-account. |
Delete three devices
{ "devicesToDelete": [ { "deviceIds": [ { "id": "09005470263", "kind": "esn" } ] }, { "deviceIds": [ { "id": "85000022411113460014", "kind": "iccid" } ] }, { "deviceIds": [ { "id": "85000022412313460016", "kind": "iccid" } ] } ] }
Status 200
Contains the device identifiers and a success or failure response for each device in the request.
Parameter Name | Data Type | Description |
---|---|---|
deviceIds | Identifiers for the device. | |
id
|
string | The value of the device identifier. |
kind
|
string | The type of the device identifier. |
status | string | “Success” if the device was deleted, or “Failed” if there was a problem. |
message | string | Not present if status=Success. One of these messages if status=Failed:
|
Two devices are successfully deleted and one is not.
{ "deleteDevicesResponse":[ { "deviceIds":{ "id":"09005470263", "kind":"esn" }, "status":"Success" }, { "deviceIds":{ "id":"85000022411113460014", "kind":"iccid" }, "status":"Success" }, { "deviceIds":{ "id":"85000022412313460016", "kind":"iccid" }, "status":"Failed", "message": "The device is not in deactive state." } ] }
Status 400
All error messages are returned in this format:
{ "errorCode": "error code string", "errorMessage": "error message string" }
Error codes and messages are listed on the Error Messages page, along with explanations and suggestions for corrective actions.