> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# User Management API

## User Management API

### Overview

<Info>
  **Prerequisites:**

  * This feature is available with the [**Paradime Enterprise pack**](https://www.paradime.io/enterprise).
  * Your API keys ***must*** have either User Management Admin or User Metadata Viewer capabilities.
</Info>

<Info>
  The examples below authenticate with an **account API key** — pass `Authorization: Bearer <token>` and `X-Paradime-Workspace: <workspace_uid>` (the account key starts with `prdm_cmp_`). Legacy **workspace API keys** are still supported: send `X-API-KEY` and `X-API-SECRET` headers instead. See API Keys.
</Info>

The User Management API enables you to efficiently administer and regulate user access within your workspace.

### List Users

This endpoint will return a list of all the current active and invited users in your workspace.

**Example Request**

<Tabs>
  <Tab title="GraphQL">
    ```python theme={"system"}
    import requests
    import os

    # API credentials
    api_endpoint = "<YOUR_API_ENDPOINT>"
    api_token = "<YOUR_API_TOKEN>"          # account API key (starts with prdm_cmp_)
    workspace_uid = "<YOUR_WORKSPACE_UID>"

    graphql_query = """
    query ListUsers {
        listUsers {
            ok
            activeUsers {
                uid
                email
                name
                accountType
            }
            invitedUsers {
                email
                accountType
                inviteStatus
            }
        }
    }
      """
      
    response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}",
          "X-Paradime-Workspace": workspace_uid,
      })

    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl -X POST "<YOUR_API_ENDPOINT>" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer <YOUR_API_TOKEN>" \
         -H "X-Paradime-Workspace: <YOUR_WORKSPACE_UID>" \
         -d '{
           "query": "query ListUsers { listUsers { ok activeUsers { uid email name accountType } invitedUsers { email accountType inviteStatus } } }"
         }'
    ```
  </Tab>
</Tabs>

<Accordion title="Example response">
  ```json theme={"system"}
  {
    "data": {
      "listUsers": {
        "ok": true,
        "activeUsers": [
          {
            "uid": "1b051b1e1aaf70773789c250cd0cc40a5bf27c104d1ca2c6b765767eb53c4772",
            "email": "alexandra@acme.io",
            "name": "Alexandra James",
            "accountType": "ADMIN"
          },
          {
            "uid": "0b02bde0691e9a220f8fdbff93d992a7826c7ce7b0ea33ffc4709c6a2d219a49",
            "email": "jonny@acme.io",
            "name": "Jonathan Maxwell",
            "accountType": "ADMIN"
          },
          {
            "uid": "07673b48d2206dad7a150dd258ea1e049df036356f1730e30304e38ca648b175",
            "email": "matt@acme.io",
            "name": "Matt McDonald",
            "accountType": "DEVELOPER"
          }
        ],
        "invitedUsers": [
          {
            "email": "max@acme.io",
            "accountType": "ADMIN",
            "inviteStatus": "EXPIRED"
          },
          {
            "email": "john@acme.io",
            "accountType": "ADMIN",
            "inviteStatus": "ACTIVE"
          }
        ]
      }
    }
  }
  ```
</Accordion>

### Invite Users

This endpoint will enable you to invite users to your workspace.

**Example Request**

<Tabs>
  <Tab title="GraphQL">
    ```python theme={"system"}
    import requests
    import os

    # API credentials
    api_endpoint = "<YOUR_API_ENDPOINT>"
    api_token = "<YOUR_API_TOKEN>"          # account API key (starts with prdm_cmp_)
    workspace_uid = "<YOUR_WORKSPACE_UID>"

    graphql_query = """
    mutation InviteUser {
        inviteUser(email: "alice@acme.io", accountType: DEVELOPER) {
            ok
        }
    }
      """
      
    response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}",
          "X-Paradime-Workspace": workspace_uid,
      })

    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl -X POST "<YOUR_API_ENDPOINT>" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer <YOUR_API_TOKEN>" \
         -H "X-Paradime-Workspace: <YOUR_WORKSPACE_UID>" \
         -d '{
           "query": "mutation InviteUser($email: String!, $accountType: UserAccountType!) { inviteUser(email: $email, accountType: $accountType) { ok } }",
           "variables": {
             "email": "alice@acme.io",
             "accountType": "DEVELOPER"
           }
         }'
    ```
  </Tab>
</Tabs>

<Accordion title="Example response">
  ```json theme={"system"}
  {
    "data": {
      "inviteUser": {
        "ok": true
      }
    }
  }
  ```
</Accordion>

### Update User Role

This endpoint will enable you to update the role of a current signed up user in your workspace.

**Example Request**

<Tabs>
  <Tab title="GraphQL">
    ```python theme={"system"}
    import requests
    import os

    # API credentials
    api_endpoint = "<YOUR_API_ENDPOINT>"
    api_token = "<YOUR_API_TOKEN>"          # account API key (starts with prdm_cmp_)
    workspace_uid = "<YOUR_WORKSPACE_UID>"

    graphql_query = """
    mutation UpdateUserAccountType {
        updateUserAccountType(
            uid: "b6982657f4f7f796945a5c9ca8980e5a2ddf9f94fd7a54fb98b7740fdd54821b"
            accountType: DEVELOPER
        ) {
            ok
        }
    }
      """
      
    response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}",
          "X-Paradime-Workspace": workspace_uid,
      })

    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl -X POST "<YOUR_API_ENDPOINT>" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer <YOUR_API_TOKEN>" \
         -H "X-Paradime-Workspace: <YOUR_WORKSPACE_UID>" \
         -d '{
           "query": "mutation UpdateUserAccountType($uid: String!, $accountType: UserAccountType!) { updateUserAccountType(uid: $uid, accountType: $accountType) { ok } }",
           "variables": {
             "uid": "b6982657f4f7f796945a5c9ca8980e5a2ddf9f94fd7a54fb98b7740fdd54821b",
             "accountType": "DEVELOPER"
           }
         }'
    ```
  </Tab>
</Tabs>

<Accordion title="Example response">
  ```json theme={"system"}
  {
    "data": {
      "updateUserAccountType": {
        "ok": true
      }
    }
  }
  ```
</Accordion>

### Disable User

This endpoint will enable you to disable a user from your workspace.

**Example Request**

<Tabs>
  <Tab title="GraphQL">
    ```python theme={"system"}
    import requests
    import os

    # API credentials
    api_endpoint = "<YOUR_API_ENDPOINT>"
    api_token = "<YOUR_API_TOKEN>"          # account API key (starts with prdm_cmp_)
    workspace_uid = "<YOUR_WORKSPACE_UID>"

    graphql_query = """
    mutation DisableUser {
        disableUser(uid: "c24d93ba3f6e743bf97a7b5b48c2b7931f6d57d022501cdb2fb983264efc0c29") {
            ok
        }
    }
      """
      
    response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}",
          "X-Paradime-Workspace": workspace_uid,
      })

    print(response.json())
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"system"}
    curl -X POST "<YOUR_API_ENDPOINT>" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer <YOUR_API_TOKEN>" \
         -H "X-Paradime-Workspace: <YOUR_WORKSPACE_UID>" \
         -d '{
           "query": "mutation DisableUser($uid: String!) { disableUser(uid: $uid) { ok } }",
           "variables": {
             "uid": "c24d93ba3f6e743bf97a7b5b48c2b7931f6d57d022501cdb2fb983264efc0c29"
           }
         }'
    ```
  </Tab>
</Tabs>

<Accordion title="Example response">
  ```json theme={"system"}
  {
    "data": {
      "disableUser": {
        "ok": true
      }
    }
  }
  ```
</Accordion>


## Related topics

- [API Reference](/developers/graphql-api/api-reference/index.md)
- [GraphQL API](/developers/graphql-api/index.md)
- [Authentication](/developers/graphql-api/authentication.md)
- [User Management](/developers/python-sdk/modules/user-management.md)
- [Workspace Management API](/developers/graphql-api/api-reference/workspace-management-api.md)
