API Reference
## Delete Devices 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 devices/actions/delete` ### Header Parameters The request header must set the content-type to JSON, contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit [Getting Started](https://thingspace.verizon.com/documentation/api-documentation.html#/http/connectivity-management/guides/getting-started/introduction-to-the-connectivity-management-api). |Parameter Name|Data Type|Description| |-----|-----|-----| | **Authorization** *(required)* | string | HTTP Authorization request header containing a valid Bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token returned by a Connectivity Management `POST /session/login` request. | | **Content-Type** *(required)* | string | Must be `application/json`. | ### HTTP Request [POST https://thingspace.verizon.com/api/m2m/v1/devices/actions/delete](/docs/standard-apis/connectivity-management/api-endpoints/device-management/delete-deactivated-devices/deletedeactivateddevices) ### Request Parameters The request body identifies the devices to delete. | Parameter Name | Type | Description | |------------|------------|------------| | **devicesToDelete** *(required)* | array | A array 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 | One object per device to be deleted. Each object must contain a kind and id element identifying the device. | | **kind, id** *(required)* | string | The type and value of the device identifier. <br> **ESN** - Electornic Serial Number, 11 digits <br> **ICCID** - Integrated Circuit Card ID, up to 20 digits <br> **IMEI** - International Mobile Equipmet Identifier, up to 16 digits <br> **EID** - Embedded Identity Document, 32 digits | | **accountName** *(optional but Recommended)* | string | The Verizon billing account that the device group belongs to. An account name is numeric and must include any leading zeros. This is recommedned because coding for the account number today, you prevent future code from breaking if you ever add a new sub-account. | ### Example Request Body Delete three devices ```json { "devicesToDelete":[ { "deviceIds":[ { "id":"11-digit ESN", "kind":"esn" } ] }, { "deviceIds":[ { "id":"20-digit ICCID", "kind":"iccid" } ] }, { "deviceIds":[ { "id":"20-digit ICCID", "kind":"iccid" } ] } ] } ``` ### Success Responses **Status 200** Contains the device identifiers and a success or failure response for each device in the request. ### Example Response Two devices are successfully deleted and one is not. ```json { "deleteDevicesResponse":[ { "deviceIds":{ "id":"11-digit ESN", "kind":"esn" }, "status":"Success" }, { "deviceIds":{ "id":"20-digit ICCID", "kind":"iccid" }, "status":"Success" }, { "deviceIds":{ "id":"20-digit ICCID", "kind":"iccid" }, "status":"Failed", "message":"The device is not in deactive state." } ] } ``` ### Response Parameters | Parameter Name | Type | Description | |--------------|------------|---------------------| | **deleteDevicesResponse** | array | An array of deviceId objects. | | **deviceIds** | object | Identifiers for the devices, containing a `kind` and `id`. | | **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`. if `status = Failed` then this will provide troubleshooting information (i.e. The device is not in deactivate state. The user does not have access to delete the device.). |