# Api search for device by identity\_data json object

**URL:** <https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477>\
**Category:** General Discussions\
**Tags:** api\
**Created:** [April 8, 2021, 6:01pm UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477 "2021-04-08T18:01:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![profff](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/profff/32/1117_2.png) [@profff](https://hub.mender.io/u/profff)\
**Post date:** [April 8, 2021, 6:01pm UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477/1 "2021-04-08T18:01:55Z")

</div>

I dont seen that into the API doc but may be I missed somthing  
I need to check if the new device I tring to preauth is already recorded and what auth status it get but I dont want to filter every other devices so I would be able to get device that match with my iddentity\_data json object and not the others  
is it possible ?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 8, 2021, 8:28pm UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477/2 "2021-04-08T20:28:55Z")

</div>

Does the [search API](https://docs.mender.io/api/#search-devices) work for you?

---

<div class="post-metadata">

**Author:** ![profff](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/profff/32/1117_2.png) [@profff](https://hub.mender.io/u/profff)\
**Post date:** [April 9, 2021, 7:57am UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477/3 "2021-04-09T07:57:49Z")

</div>

unfortunatly not … because if I’m not wrong we can only filter by STATUS or ID

```auto
» status body string false Device status filter. Can be an array for querying devices from multiple device statuses.
» id body [string] false Device ID filter. Can be a string for querying for a single device.

```

what I would like is to filter by iddentity\_data

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 9, 2021, 1:28pm UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477/4 "2021-04-09T13:28:48Z")

</div>

I see. I guess you will have to filter in your code then. Perhaps @peter has a better suggestion.

Drew

---

<div class="post-metadata">

**Author:** ![profff](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/profff/32/1117_2.png) [@profff](https://hub.mender.io/u/profff)\
**Post date:** [April 12, 2021, 8:14am UTC](https://hub.mender.io/t/api-search-for-device-by-identity-data-json-object/3477/5 "2021-04-12T08:14:56Z")

</div>

it’s not a big issue I will do it on my side  
it’s not as convenient but not a big deal neither
