# Device Inventory API: Search by tags

**URL:** https://hub.mender.io/t/device-inventory-api-search-by-tags/6539
**Category:** General Discussions
**Tags:** api
**Created:** [February 7, 2024, 9:47pm UTC](https://hub.mender.io/t/device-inventory-api-search-by-tags/6539 "2024-02-07T21:47:47Z")
**Posts on this page:** 3
**Page:** 1

<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: [February 7, 2024, 9:47pm UTC](https://hub.mender.io/t/device-inventory-api-search-by-tags/6539/1 "2024-02-07T21:47:47Z")

</div>

Hi there,

I’m trying to use the device inventory API on our self-hosted open source instance (`https://example-instance/api/management/v1/inventory/devices?Tag=00999`) to look for a device with a specific tag value, however for some reason it returns a blank array. There is a device in a group that contains this tag, and the tag is filterable as an “attribute”, as it’s displayed under attributes when I query the device ID, and is shown as such when I query `https://example-instance/api/management/v2/inventory/filters/attributes`.

Any idea where I could be going wrong here?

---

<div class="post-metadata">

### Author: ![kjaskiewiczz](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kjaskiewiczz/32/807_2.png) [@kjaskiewiczz](https://hub.mender.io/u/kjaskiewiczz)
#### Post date: [February 12, 2024, 10:04am UTC](https://hub.mender.io/t/device-inventory-api-search-by-tags/6539/2 "2024-02-12T10:04:58Z")

</div>

Hey,  
You need to add scope to the query - try `https://example-instance/api/management/v1/inventory/devices?tags/Tag=00999`

---

<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: [February 12, 2024, 11:00pm UTC](https://hub.mender.io/t/device-inventory-api-search-by-tags/6539/4 "2024-02-12T23:00:05Z")

</div>

That worked! Thanks for your help! 😄
