Remove unused licenses from devices:

POST /licenses/{account}/remove

Remove unused licenses from device. A license is unused if the device has not had a firmware upgrade since the license was assigned, and if no firmware upgrade is in progress for the device.

Note: This request is only needed for accounts that have a monthly recurring billing (MRC) subscription. Accounts with event-based billing do not need to assign or remove licenses.

Contents

See also:
Assign licenses to devices
Get a list of devices

Uses and Requirements

If a firmware upgrade has been scheduled for a device but has not started when a license is removed, the upgrade is canceled.

After a license has been removed from a device, it goes back into the pool of total licenses for the account and can be assigned to a different device.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/fota/v1//licenses/{account}/remove

Resource Path and Query Parameters

You must include the account name in the path.

Parameter Name Data Type Description
Parameter Nameaccount
required
Data Typestring DescriptionThe name of the account for which you want to remove licenses. An account name is usually numeric, and must include any leading zeros.

Header Parameters

The request header must contain a current ThingSpace authorization token and a current VZ-M2M session token, and must set the Content-Type to JSON.

Parameter Name Data Type Description
Parameter NameAuthorization
required
Data Typestring DescriptionHTTP Authorization request header containing a valid Bearer token.
Parameter NameVZ-M2M-Token
required
Data Typestring DescriptionA valid session token returned by a Connectivity Management POST /session/login request.
Parameter NameContent-Type
required
Data Typestring DescriptionMust be application/json.

Request Body

The request body identifies the devices to remove licenses from.

Parameter Name Data Type Description
Parameter NamedeviceList
required
Data Typearray of IMEI strings DescriptionThe IMEIs of the devices that you want to remove licenses from.

Example Request

Remove licenses from three devices:

curl https://thingspace.verizon.com/api/fota/v1/licenses/$ACCOUNT/remove -H 'Authorization: Bearer $AUTH_TOKEN' -H 'VZ-M2M-Token: $M2M_TOKEN' -H 'Content-Type: application/json' -d 
{
  "deviceList": [
    "900000000000001", 
    "900000000000998", 
    "900000000000999"
  ]
}

Success Responses

Status 200

A successful request returns this information:

Parameter Name Data Type Description
Parameter NameaccountName Data Typestring DescriptionThe name (number) of the billing account.
Parameter NamelicCount Data Typeinteger DescriptionThe total number of monthly licenses in the MRC subscription.
Parameter NamelicUsedCount Data Typeinteger DescriptionThe number of licenses assigned to devices after the completion of the remove request.
Parameter NamedeviceList Data Typearray of objects DescriptionA JSON object for each device that was in the request
Parameter Name
deviceId
Data Typestring DescriptionThe IMEI of the device.
Parameter Name
status
Data Typestring Description“LicenseRemoveSuccess” or “LicenseRemoveFailed.
Parameter Name
Reason
Data Typestring DescriptionMore information about the status, such as “Success” or a reason for a failure, such as “No license attached to device.”

Example Success Response

{
  "accountName": "0242078689-00001",
  "licCount": 9000,
  "licUsedCount": 998,
  "deviceList": [
    {
      "deviceId": "900000000000001",
      "status": "LicenseRemoveSuccess",
      "Reason": "Success"
    },
    {
      "deviceId": "900000000000998",
      "status": "LicenseRemoveSuccess",
      "Reason": "Success"
    },
    {
      "deviceId": "900000000000999",
      "status": "LicenseRemoveFailed",
      "Reason": "No license attached to device"
    }
  ]
}

Failure Responses

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.