# How to query applications using management api with filters

**URL:** <https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109>\
**Category:** Get Help\
**Created:** [August 21, 2022, 3:06am UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109 "2022-08-21T03:06:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmj](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmj/32/35970_2.png) [@jmj](https://community.auth0.com/u/jmj)\
**Post date:** [August 21, 2022, 3:06am UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/1 "2022-08-21T03:06:41Z")

</div>

How to filter application using their metadata while querying using management API [Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Clients/get_clients)

An example request payload will help.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [August 26, 2022, 6:02pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/3 "2022-08-26T18:02:00Z")

</div>

Hi @jmj ,

Here is the payload to filter by application’s client id.

```auto
GET https://{{auth0_domain}}/api/v2/clients

{
    "client_id": "your client id"
}

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![jmj](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmj/32/35970_2.png) [@jmj](https://community.auth0.com/u/jmj)\
**Post date:** [August 26, 2022, 6:23pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/4 "2022-08-26T18:23:05Z")

</div>

Hi @lihua.zhang - I understand filtering by client\_id is available. my question is specific to client\_metadata. Can I use them like

```auto
{

    "metadata" {
      "metadata_key" : "filter-val"
    }
}

```

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [August 26, 2022, 6:50pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/5 "2022-08-26T18:50:47Z")

</div>

Hi @jmj ,

I tried querying client metadata with your script and it works.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/5/a55eac85edbdcca759d13f415cfe735cc1140689.png)

Does it work for you?

---

<div class="post-metadata">

**Author:** ![jmj](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmj/32/35970_2.png) [@jmj](https://community.auth0.com/u/jmj)\
**Post date:** [August 26, 2022, 7:33pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/6 "2022-08-26T19:33:25Z")

</div>

Thanks - I guess I should have just tried it first 🙂 - Thank you.

---

<div class="post-metadata">

**Author:** ![jmj](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmj/32/35970_2.png) [@jmj](https://community.auth0.com/u/jmj)\
**Post date:** [August 26, 2022, 9:18pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/7 "2022-08-26T21:18:25Z")

</div>

I tried this from auth0 management go SDK

```auto
appList, err := management.Client.List(management.IncludeFields("client_id", "client_metadata", "client_secret", "description", "name"), management.Query("{ \"client_metadata\": { \"key1\": \"val1\",\"key2\": \"val2\"}}"))

```

it returns me all the applications. Filter is ignored. What is wrong here?

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [August 26, 2022, 11:30pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/8 "2022-08-26T23:30:41Z")

</div>

Hi @jmj ,

I did more tests and checked the internal conversation and realized that we can not filter by client metadata using the Management API endpoint. Regardless of what parameters we use to filter clients in the body scripts, it will always return all the applications. Sorry about the miscommunication earlier.

If you are interested in this feature, please communicate with our product team directly via [feedback](https://auth0.com/feedback). Thanks!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 21, 2022, 5:14pm UTC](https://community.auth0.com/t/how-to-query-applications-using-management-api-with-filters/89109/9 "2022-12-21T17:14:02Z")

</div>


