> For the complete documentation index, see [llms.txt](https://api.intecular.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.intecular.com/invisoutlet-c-pro/ota/perform-ota-update.md).

# Perform OTA Update

\[TCP <--> InvisOutlet]

> Performing updates to the latest firmware for either InvisOutlet or InvisDeco.

**Request**

* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet. This can be any six digit number, no leading zeros.
* <mark style="color:red;">`payload`</mark>:&#x20;
  * <mark style="color:red;">`callbackName`</mark>: 21
  * <mark style="color:red;">`callbackArgs`</mark>:&#x20;
    * `0`: Specifies which device to update; 1 - InvisOutlet, 2 - InvisDeco.
    * `1`: Specifies which method to update InvisDeco; 0 - via Wi-Fi, 1 - via InvisOutlet

{% hint style="info" %}
If you are having trouble using the *via Wi-Fi* method to update InvisDeco, please try to update InvisDeco via the *via InvisOutlet* method.
{% endhint %}

```json
{
  "packetID": 414883,  
  "payload":
  {
    "callbackName": 21,  
    "callbackArgs": [1,0] 
  }
}
```

**Response (revB, synchronous)**

* <mark style="color:red;">`sn`</mark>: The serial number of the InvisOutlet.
* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet based on request <mark style="color:red;">`packetID`</mark>.
* <mark style="color:red;">`payload`</mark>:&#x20;
  * <mark style="color:red;">`callbackName`</mark>: 21
  * <mark style="color:red;">`callbackArgs`</mark>:
    * `0`: Specifies which device is performing the update; 1 - InvisOutlet, 2 - InvisDeco.
    * `1`: Specifies whether the OTA is performed successfully or not; 1 - OTA will continue to perform, 0 - Fail

```json
{
    "sn": "0003C44076",
    "packetID": 414883,
    "payload":
    {
        "callbackName": 21,
        "callbackArgs": [1,1]
    }
}
```

{% hint style="info" %}
The device will restart immediately to perform the OTA update.

In order to receive the response, you will need to reconnect the TCP connection again.
{% endhint %}

{% hint style="info" %}
The OTA update status will be updated via [OTA Download Progress (Synchronous)](/invisoutlet-pro/ota/ota-download-progress-synchronous.md) and [OTA Result Update (Synchronous)](/invisoutlet-pro/ota/ota-result-update-synchronous.md). Please note the <mark style="color:red;">`packetID`</mark> will be different then the requested <mark style="color:red;">`packetID`</mark>.
{% endhint %}
