# Get uuid from custom attribute

**URL:** <https://hub.mender.io/t/get-uuid-from-custom-attribute/6559>\
**Category:** General Discussions\
**Created:** [February 15, 2024, 4:42pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559 "2024-02-15T16:42:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [February 15, 2024, 4:42pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/1 "2024-02-15T16:42:09Z")

</div>

When doing API requests to Mender I would like to resolve the device uuid used for other operations like tunnel. This seems to not be available. Instead there’s only a request to get all devices.  
When you have a fleet of over 1000 devices this is not efficient.

For example all devices report the real serial number with the attribute “serialno” , I would like to get the UUID from that.

Is there such a feature now, or can it be requested?

Can I start a tunnel session locally on the device? I still need the uuid, and I understand that this is only on the server and not the client. Can I request the UUID somehow locally on the device then?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 16, 2024, 12:28pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/2 "2024-02-16T12:28:37Z")

</div>

Hi @emilm,

There are endpoints that allow searching for devices. I think adapting this should help you: [Device Inventory API: Search by tags - #2 by kjaskiewiczz](https://hub.mender.io/t/device-inventory-api-search-by-tags/6539/2)

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [February 16, 2024, 12:42pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/3 "2024-02-16T12:42:21Z")

</div>

Thanks! I use 3.1.0 , was it introduced after that?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 16, 2024, 12:47pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/4 "2024-02-16T12:47:51Z")

</div>

@emilm nope: [Mender API docs](https://docs.mender.io/api/3.1/#management-api-device-inventory-list-device-inventories)

Though I don’t know right from top of my head if this is present in the OSS version, sorry.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [February 16, 2024, 1:19pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/5 "2024-02-16T13:19:48Z")

</div>

Thanks.

It is not tag I think. Tags are what you define yourself. I am talking about the attribute the device reports.

It is the /usr/share/mender/identity/mender-device-identity script that reports the custom attributes like it’s real serial number.

[https://docs.mender.io/api/#management-api-device-inventory](https://docs.mender.io/api/#management-api-device-inventory)

hostname works but not my custom attribute _serialno_ sent from the device even though it’s listed…

/inventory/devices?serialno=blah

I prefer to get the serialno which is always correct. Can’t always trust the hostname

---

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [March 15, 2024, 1:51pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/6 "2024-03-15T13:51:24Z")

</div>

Any updates on this?

---

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [March 20, 2024, 2:21pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/7 "2024-03-20T14:21:29Z")

</div>

Any idea about this?

---

<div class="post-metadata">

**Author:** ![pyxlwuff](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pyxlwuff](https://hub.mender.io/u/pyxlwuff)\
**Post date:** [March 20, 2024, 3:49pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/8 "2024-03-20T15:49:23Z")

</div>

Have you tried `https://your-mender-instance/api/management/v1/inventory/devices?identity/serialno=12345`? Was able to fetch a custom identity value I set in `mender-device-identity` with that

---

<div class="post-metadata">

**Author:** ![emilm](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/emilm/32/449_2.png) [@emilm](https://hub.mender.io/u/emilm)\
**Post date:** [March 21, 2024, 1:07pm UTC](https://hub.mender.io/t/get-uuid-from-custom-attribute/6559/9 "2024-03-21T13:07:57Z")

</div>

as I mentioned in my earlier post:  
/inventory/devices?serialno=blah

I use identity/serialno= now  
That worked!!!

Thank you!
