# Filter groups by name in Python API SDK

**URL:** <https://devforum.okta.com/t/filter-groups-by-name-in-python-api-sdk/31846>\
**Category:** API\
**Tags:** python\
**Created:** [January 31, 2025, 1:23pm UTC](https://devforum.okta.com/t/filter-groups-by-name-in-python-api-sdk/31846 "2025-01-31T13:23:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.wasserman1](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matt.wasserman1](https://devforum.okta.com/u/matt.wasserman1)\
**Post date:** [January 31, 2025, 1:23pm UTC](https://devforum.okta.com/t/filter-groups-by-name-in-python-api-sdk/31846/1 "2025-01-31T13:23:17Z")

</div>

I am trying to retrieve a group by name using list\_groups. Retrieving the entire list with client.list\_groups() works perfectly. But if I use q= or query= or filter= I get an unexpected keyword error. If I just use the group name I get an invalid URL string error.

Pretty sure there has to be a way to do this, it works fine with HTTP requests. I just can’t find any documentation for the correct syntax.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [March 2, 2025, 1:24pm UTC](https://devforum.okta.com/t/filter-groups-by-name-in-python-api-sdk/31846/2 "2025-03-02T13:24:06Z")

</div>

Closed on March 2, 2025, 1:24pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
