# A hack to change the device hostname

**URL:** <https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195>\
**Category:** Product support\
**Tags:** pendinguserresponse\
**Created:** [April 23, 2019, 10:20am UTC](https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195 "2019-04-23T10:20:30Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![pcarranzav](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pcarranzav/32/94_2.png) [@pcarranzav](https://forums.balena.io/u/pcarranzav)\
**Post date:** [May 7, 2019, 9:41pm UTC](https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195/29 "2019-05-07T21:41:41Z")

</div>

Hi @ajlennon indeed, using the `Authorization: Bearer $BALENA_SUPERVISOR_API_KEY` header is not supported when calling the supervisor API directly. However, you can use `ApiKey` instead of Bearer, so `Authorization: ApiKey $BALENA_SUPERVISOR_API_KEY` should work (without the need for `?apikey=` on the query parameters). I’ll make a note to update our docs on this, cause you’re right that they only mention the query parameter option.

---

<div class="post-metadata">

**Author:** ![ajlennon](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ajlennon/32/63_2.png) [@ajlennon](https://forums.balena.io/u/ajlennon)\
**Post date:** [May 7, 2019, 9:55pm UTC](https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195/30 "2019-05-07T21:55:17Z")

</div>

Thanks @pcarranzav - will try tomorrow x

---

<div class="post-metadata">

**Author:** ![ajlennon](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ajlennon/32/63_2.png) [@ajlennon](https://forums.balena.io/u/ajlennon)\
**Post date:** [May 9, 2019, 8:30am UTC](https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195/32 "2019-05-09T08:30:53Z")

</div>

Excellent - thanks again @pcarranzav - this does the job!

```auto
bash-4.4# cat checkit.sh 
curl -X GET -H "Authorization: ApiKey ${BALENA_SUPERVISOR_API_KEY}" \
 -H "Content-Type: application/json" \
  "${BALENA_SUPERVISOR_ADDRESS}/v1/device/host-config"

```

[Previous page](https://forums.balena.io/t/a-hack-to-change-the-device-hostname/6195.md?page=1)
