# BUG: Api / Reboot Task returns status 500 for a non existent device id

**URL:** https://forum.genieacs.com/t/bug-api-reboot-task-returns-status-500-for-a-non-existent-device-id/2581
**Category:** Uncategorized
**Created:** [April 19, 2022, 11:10pm UTC](https://forum.genieacs.com/t/bug-api-reboot-task-returns-status-500-for-a-non-existent-device-id/2581 "2022-04-19T23:10:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MarkAtAgilliance](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/markatagilliance/32/833_2.png) [@MarkAtAgilliance](https://forum.genieacs.com/u/MarkAtAgilliance)
#### Post date: [April 19, 2022, 11:10pm UTC](https://forum.genieacs.com/t/bug-api-reboot-task-returns-status-500-for-a-non-existent-device-id/2581/1 "2022-04-19T23:10:34Z")

</div>

Hi, FYI, I am doing a lot of testing (in bound and out of bound) for an interface I am building to GenieACS.

When I send a reboot request with a deliberately incorrect deviceID, the server returns a 500 code with a response string of “No such device”.

Expected value would be either 400 (Bad Request) or 422 (Unprocessable Entry). Some folks use a 404 (Not Found) on a POST request but while not strictly correct, it would be ok since this is an action and not a resource create request. All are better than 500 (which normally indicates a server barf vs a client barf (4xx codes). I am sure there will be a few opinions on wich 4xx code to use so will leave that to you.

Bug is non-blocking since work around is of course to translate the 500 to a 422 , 404 or 400 when the message contains “No such device”(my choice).  
Mark.

---

<div class="post-metadata">

### Author: ![PremDas](https://avatars.discourse-cdn.com/v4/letter/p/2acd7d/32.png) [@PremDas](https://forum.genieacs.com/u/PremDas)
#### Post date: [April 22, 2024, 12:40pm UTC](https://forum.genieacs.com/t/bug-api-reboot-task-returns-status-500-for-a-non-existent-device-id/2581/2 "2024-04-22T12:40:48Z")

</div>

Why i am geeting Not found Response in reboot api
