# Restart all devices in an application using the api

**URL:** <https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929>\
**Category:** Product support\
**Created:** [October 15, 2019, 7:05pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929 "2019-10-15T19:05:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 15, 2019, 7:05pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/1 "2019-10-15T19:05:12Z")

</div>

Hello,

Is it possible to “Restart all devices in an application using the api”?

Thanks

---

<div class="post-metadata">

**Author:** ![dfunckt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dfunckt/32/56_2.png) [@dfunckt](https://forums.balena.io/u/dfunckt)\
**Post date:** [October 15, 2019, 7:20pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/4 "2019-10-15T19:20:45Z")

</div>

If you use the CLI the command is this one: [https://www.balena.io/docs/reference/cli/#app-restart-name](https://www.balena.io/docs/reference/cli/#app-restart-name)

You can also `POST /application/:appId/restart` making sure to include some sort of authentication, eg your JWT which can be retrieved from the Dashboard as a header like so: `Authorization: Bearer $YOUR_JWT`.

---

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 15, 2019, 7:48pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/8 "2019-10-15T19:48:46Z")

</div>

Thanks for the great answer.

The cli would be fine, but I tried and it does nothing =/. Other commands like `balena apps` returns just fine.

---

<div class="post-metadata">

**Author:** ![dfunckt](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dfunckt/32/56_2.png) [@dfunckt](https://forums.balena.io/u/dfunckt)\
**Post date:** [October 15, 2019, 8:30pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/9 "2019-10-15T20:30:27Z")

</div>

Can you try running the command with DEBUG=1, like so `DEBUG=1 balena app restart MyApp`, and share the output?

---

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 15, 2019, 8:42pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/11 "2019-10-15T20:42:41Z")

</div>

> [@dfunckt](#):
>
> :appId/restart

[debug] original argv0=“node” argv=[/Users/deoqc/.nvm/versions/node/v8.16.2/bin/node,/Users/deoqc/.nvm/versions/node/v8.16.2/bin/balena,app,restart,BlueMarlin] length=5

---

<div class="post-metadata">

**Author:** ![xginn8](https://avatars.discourse-cdn.com/v4/letter/x/8baadc/32.png) [@xginn8](https://forums.balena.io/u/xginn8)\
**Post date:** [October 16, 2019, 5:37pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/12 "2019-10-16T17:37:21Z")

</div>

Hi there,

Just to clarify, are you trying to restart all containers on devices within an app, or rather reboot the device itself?

---

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 16, 2019, 5:57pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/14 "2019-10-16T17:57:05Z")

</div>

I would prefer justo to restart all containers on devices, but reboot is also ok.

---

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 21, 2019, 1:48pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/18 "2019-10-21T13:48:58Z")

</div>

Any idea?

---

<div class="post-metadata">

**Author:** ![CameronDiver](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@CameronDiver](https://forums.balena.io/u/CameronDiver)\
**Post date:** [October 21, 2019, 2:05pm UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/20 "2019-10-21T14:05:44Z")

</div>

Hey, it looks like there is an issue with the method of restarting the device containers with certain versions of the supervisor. We have identified the problem and should be patching it very soon. I’ll attach the internal ticket to this thread so once it closes we can let you know 🙂

---

<div class="post-metadata">

**Author:** ![deoqc](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deoqc](https://forums.balena.io/u/deoqc)\
**Post date:** [October 22, 2019, 10:52am UTC](https://forums.balena.io/t/restart-all-devices-in-an-application-using-the-api/36929/23 "2019-10-22T10:52:52Z")

</div>

Thx very much.
