> ## 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

> Manage users, roles, and workspace access in Paradime programmatically through the GraphQL user management API for provisioning and offboarding.

## User Management API

### Overview

> [!NOTE]
>
> **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.

> [!NOTE]
>
> 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.

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**

> [tab] 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] 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 } } }"
>      }'
> ```

> [accordion] 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": "SENT"
>         }
>       ]
>     }
>   }
> }
> ```

### Invite Users

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

**Example Request**

> [tab] 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] 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"
>        }
>      }'
> ```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "inviteUser": {
>       "ok": true
>     }
>   }
> }
> ```

### Update User Role

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

**Example Request**

> [tab] 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] 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"
>        }
>      }'
> ```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "updateUserAccountType": {
>       "ok": true
>     }
>   }
> }
> ```

### Disable User

This endpoint removes a user from a workspace. The user loses access to that workspace straight away. This is a soft delete, so you can invite the user back later.

> [!WARNING]
>
> **Before you disable users:**
>
> * The user is removed only from the workspace in the `X-Paradime-Workspace` header. If the user is a member of more than one workspace, call `disableUser` once for each workspace. Otherwise the user keeps access to the other workspaces.
> * The response is `ok: true` even when the `uid` is not a member of the workspace. Run [List Users](#list-users) again to confirm the user was removed.
> * If the workspace has [auto-join](https://docs.paradime.io/products/settings/users/enable-auto-join.md) domains set, a removed user whose email matches an allowed domain can join the workspace again the next time they log in. To stop this, remove the domain from the allowed list or remove the user in your identity provider.
> * Your API key must have the User Management Admin capability.

**Example Request**

> [tab] 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] 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"
>        }
>      }'
> ```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "disableUser": {
>       "ok": true
>     }
>   }
> }
> ```


## Related topics

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.