# Rename a device from API

**URL:** <https://community.homey.app/t/rename-a-device-from-api/108341>\
**Category:** Developers\
**Tags:** homey-pro\
**Created:** [April 17, 2024, 7:45am UTC](https://community.homey.app/t/rename-a-device-from-api/108341 "2024-04-17T07:45:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Pham](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_pham/32/79935_2.png) [@Peter\_Pham](https://community.homey.app/u/Peter_Pham)\
**Post date:** [April 17, 2024, 7:45am UTC](https://community.homey.app/t/rename-a-device-from-api/108341/1 "2024-04-17T07:45:35Z")

</div>

Hello there,

I have trouble renaming the devices, I am able to receive the correct name from the API whenever i change it in the database. How do I change the device name in the code? I am able to log the name received from the API to the console.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 17, 2024, 8:19am UTC](https://community.homey.app/t/rename-a-device-from-api/108341/2 "2024-04-17T08:19:05Z")

</div>

> [@Peter\_Pham](#):
>
> How do I change the device name in the code?

Probably using [`updateDevice`](https://athombv.github.io/node-homey-api/HomeyAPIV2.ManagerDevices.html#updateDevice).
