> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/management-and-administration/api-best-practices/examples/fetch-list.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Fetch a list of all feature flag users

Learn how to fetch a list of all users invited to your FME account using the Admin API.

## Overview <a href="#overview" id="overview"></a>

Use this script to fetch a list of all users that were invited to the FME account.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Install the [Python Admin API Wrapper](https://developer.harness.io/feature-management-experimentation/management-and-administration/api-best-practices/wrappers/python-admin-api.md).
* You have created an Admin API key from the Harness FME UI.

## Configuration <a href="#configuration" id="configuration"></a>

Before running the script, update the following variables in the code:

* `ADMIN API KEY`: Your Admin API key.

Run this script using Python 3 from your local machine or preferred development environment.

```python
from splitapiclient.main import get_client

client = get_client({'apikey': 'ADMIN API KEY'})
for user in client.users.list('ACTIVE'):
    print (user._email, user._status)
for user in client.users.list('DEACTIVATED'):
    print (user._email, user._status)
for user in client.users.list('PENDING'):
    print (user._email, user._status)
```

## Next steps

* Go to [Managing users and groups](https://developer.harness.io/feature-management-experimentation/management-and-administration/api-best-practices/users-and-groups.md) to manage users and groups with the Admin API.
* Go to [Examples](https://developer.harness.io/feature-management-experimentation/management-and-administration/api-best-practices/examples.md) to browse more Admin API examples.

{% @harness-feedback/feedback %}
