Add or remove devices from a campaign
# Add or Remove Devices in a Scheduled Upgrade: ### `PUT /upgrades/{account}/upgrade/{upgradeId}` Adds devices to a scheduled upgrade campaign or removes devices from the campaign. Devices cannot be removed once an upgrade has started. ## HTTP Request [PUT https://thingspace.verizon.com/api/fota/v1/upgrades/{account}/upgrade/{upgradeId}`](/docs/premium-apis/software-management/software-management-v1/api-endpoints/firmware-v1/updatefirmwareupgradedevices) ## Resource Path and Query Parameters You must include the account name in the path and the ID of the upgrade. | Parameter Name | Data Type | Description | |-----|-----|-----| | **account** *(required)* | string | The name of the account that has the scheduled upgrade. An account name is usually numeric, and must include any leading zeros. | | **upgradeId** *(required)* | UUID string | The UUID of the upgrade, returned by POST /upgrades when the upgrade was scheduled. | ## 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/session-management/guides/getting-started). | Parameter Name | Data Type | Description | |-----|-----|-----| | **Authorization** *(required)* | string | HTTP Authorization bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token: `VZ-M2M-Token: {M2Mtoken}` | | **Content-Type** *(required)* | string | Must be application/json `Content-Type: application/json` | ## Request Body The request body sets the type of operation (add or remove) and specifies the devices. | Parameter Name | Data Type | Description | |-----|-----|-----| | **type** *(required)* | string, enum | The type of operation, either “append” or “remove” | | **deviceList** *(required)* | array of IMEI strings | The IMEIs of the devices that you want to add or remove from the upgrade. | ## Example Request Request the details of a scheduled upgrade for an account: ```json curl -X PUT https://thingspace.verizon.com/api/fota/v1/upgrades/{account}/upgrade/{upgradeId} -H 'Authorization: Bearer {authorization}' \ -H 'VZ-M2M-Token: {M2M token}' \ -H 'Content-Type: application/json' \ { "type": "append", "devicelist": [ "15-digit IMEI", "15-digit IMEI" ] } ``` ## Success Responses A success response contains these upgrade details: | Parameter Name | Data Type | Description | |-----|-----|-----| | **accountName** | string | The name (number) of the billing account | | **id** | string | Unique upgrade identifier | | **deviceList** | array | A JSON object for each device that was included in the request, showing the device IMEI, the status of the addition or removal, and additional information about the status | | deviceList.**deviceId** | string | The device's 15-digit IMEI | | deviceList.**status** | string | Whether the device was added or removed from the upgrade campaign successfully. For example: **AddDeviceSucceed** | deviceList.**Reason** | string | More information about the status | ## Example Success Response **Status 200** ```json { "accountName":"0000123456-00001", "id":"60b5d639-ccdc-4db8-8824-069bd94c95bf", "deviceList": [ { "deviceId": "15-digit IMEI", "status": "AddDeviceSucceed", "Reason": "Device added Successfully" }, { "deviceId": "15-digit IMEI", "status": "AddDeviceSucceed", "Reason": "Device added Successfully" } ] } ``` ## Failure Responses **Status 400** All error messages are returned in this format: ```json { "errorCode": "error code string", "errorMessage": "error message string" } ``` Error codes and messages are listed on the [Error Messages](https://thingspace.verizon.com/documentation/api-documentation.html#/http/software-management/guides/error-messages) page, along with explanations and suggestions for corrective actions.