A hack to change the device hostname

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.

1 Like

Thanks @pcarranzav - will try tomorrow x

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

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"