> For the complete documentation index, see [llms.txt](https://partner.threatrix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner.threatrix.io/api-code-examples/threatcenter/admin/users.md).

# Users

## Admin User List

{% hint style="warning" %}
This endpoint requires Admin Role permissions.&#x20;
{% endhint %}

Retrieve first 25 users assigned to the organization. Includes both Approved and Unapproved users.&#x20;

{% tabs %}
{% tab title="Python" %}

```python
import requests

# Define the GraphQL endpoint URL
url = "https://app.threatrix.io/graphql"
apikey = "{THREATRIX_API_OR_SERVICE_KEY}" # Replace with your actual service key

# Example GraphQL query - adjust based on your needs
query = """
{
  users(onlyUnapproved: false, first: 25) {
    edges {
      node {
        orgId
        username
        email
        fname
        lname
        created
        permissions
        avatarUrl
        approved
        userRoles {
          roleId
          description
          permissions
          __typename
        }
        userEntities {
          edges {
            node {
              name
              __typename
            }
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
      __typename
    }
    totalCount
    __typename
  }
}

"""

# Define the headers with the Bearer token for authentication
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer "+apikey,  
}

# Define the payload to send with the request
payload = {
    "query": query
}

# Make the request to the GraphQL endpoint
response = requests.post(url, json=payload, headers=headers)

# Check if the request was successful
if response.status_code == 200:
    # Print the response data
    print("Response data:", response.json())
else:
    print(f"Request failed with status code {response.status_code}")

```

{% endtab %}
{% endtabs %}
