# Changing device deployment status without checking for update first

**URL:** <https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098>\
**Category:** General Discussions\
**Created:** [June 23, 2020, 8:16pm UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098 "2020-06-23T20:16:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![msaenger](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@msaenger](https://hub.mender.io/u/msaenger)\
**Post date:** [June 23, 2020, 8:16pm UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/1 "2020-06-23T20:16:33Z")

</div>

This might not be a typical flow, but I’m trying to change a device deployment status without checking for an update. This device has all of the required information to change the status (deployment id and auth token) but it returns an error in the request. However, as soon as I checked for an update the device then showed up in the deployment as pending and then allowed to change the status.

My question is, is it required to check for an update first before being able to update device deployment status even if you have the correct deployment ID? It seems like the first step is an update check and the server won’t recognize the device until that update check happens.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 24, 2020, 6:54am UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/2 "2020-06-24T06:54:53Z")

</div>

Interesting, it is probably the case that you need to check for the update fist to trigger some logic in the backend that will transition that device to the deployment or something (not my area really :)).

@tranchitella, can probably shed some light on this.

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [June 24, 2020, 7:03am UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/3 "2020-06-24T07:03:39Z")

</div>

@msaenger may I ask you which version of Mender you are using? Is the hosted service or are you self-hosting it? If the latter, which version?

---

<div class="post-metadata">

**Author:** ![msaenger](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@msaenger](https://hub.mender.io/u/msaenger)\
**Post date:** [June 24, 2020, 3:21pm UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/4 "2020-06-24T15:21:56Z")

</div>

Hi @tranchitella. I’m using the starter hosted mender version currently.

---

<div class="post-metadata">

**Author:** ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)\
**Post date:** [June 24, 2020, 3:38pm UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/5 "2020-06-24T15:38:10Z")

</div>

@msaenger I confirm this is how it works: device deployment records are created opportunistically when the device checks for updates and the deployment matches. We do not create them upfront, thus you cannot update the status of a device deployment which does not exist yet.

---

<div class="post-metadata">

**Author:** ![msaenger](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@msaenger](https://hub.mender.io/u/msaenger)\
**Post date:** [June 24, 2020, 4:03pm UTC](https://hub.mender.io/t/changing-device-deployment-status-without-checking-for-update-first/2098/6 "2020-06-24T16:03:05Z")

</div>

@tranchitella thanks for the confirmation!
