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

# Admin client: users

> List, invite, change the role of, deactivate and reactivate workspace users, and set auto-join domains from Python with paradime.admin.users.

`paradime.admin.users` manages a workspace's members, former members and invitees, and the email domains whose users join the workspace on sign-up. For the GraphQL operations, see [Users](https://docs.paradime.io/developers/graphql-api/admin-api/users).

> [!NOTE]
>
> **Prerequisites**
>
> * These operations are available on every plan.
> * Your API key needs the **User access admin** capability group. To only list users and read auto-join domains, **User access viewer** is enough.
> * The admin client of the `paradime-io` package. See [Admin client](https://docs.paradime.io/developers/python-sdk/modules/admin/index).

The examples on this page use this client:

```python theme={"system"}
from paradime import Paradime

paradime = Paradime(api_endpoint="API_ENDPOINT", api_secret="prdm_cmp_...", workspace_uid="WORKSPACE_UID")
```

> [!NOTE]
>
> `paradime.users`, the [User Management module](https://docs.paradime.io/developers/python-sdk/modules/user-management.md), also invites and disables users. `paradime.admin.users` adds statuses, pagination, reactivation and auto-join domains, and raises typed errors.

## List users

Iterates over the workspace's users, ordered by email, then status.

**statuses** `Optional[Sequence[UserStatus]]` (default: None)

Only users with one of these statuses: `ACTIVE`, `INVITED` or `DEACTIVATED`. Every status when left out.

**workspace\_uid** `Optional[str]` (default: None)

The workspace to read, for a company API key.

**page\_size** `int` (default: 100)

How many users to read per request, at most 500.

**Returns** `Iterator[AdminUser]`

The users, read one page at a time.

```python theme={"system"}
from paradime.apis.admin.users.types import UserStatus

for user in paradime.admin.users.list(statuses=[UserStatus.INVITED]):
    print(user.email, user.invite_status, user.invited_at)
```

## Invite a user

Invites a person by email with a role, and sends them the invitation email. An email that already belongs to a user or to a pending invitation raises `AdminConflictException`. For a former member, use [`reactivate`](#reactivate-a-user). A role that an API key can't give in the workspace raises `AdminValidationFailedException`, with `field` set to `["input", "accountType"]`.

**email** `str` *required*

The email that the invitation is sent to.

**account\_type** `UserAccountType` *required*

The role that the invitation gives. See [Roles](#roles).

**workspace\_uid** `Optional[str]` (default: None)

The workspace to change, for a company API key.

**Returns** `AdminUser`

The invitee, `INVITED` with a `PENDING` invitation.

```python theme={"system"}
from paradime.apis.admin.users.types import UserAccountType

invitee = paradime.admin.users.create("data-lead@example.com", UserAccountType.ADMIN)
print(invitee.status, invitee.invite_status)
```

## Change a user's role

Changes the role of an active member. Giving a user the role they hold is not an error.

**uid** `str` *required*

The user's uid.

**account\_type** `UserAccountType` *required*

The role that the user gets.

**workspace\_uid** `Optional[str]` (default: None)

The workspace to change, for a company API key.

**Returns** `AdminUser`

The user, with their new role. A uid that the workspace doesn't know raises `AdminNotFoundException`.

```python theme={"system"}
from paradime.apis.admin.users.types import UserAccountType

paradime.admin.users.update("USER_UID", account_type=UserAccountType.BUSINESS)
```

## Deactivate a user

Deactivates a member: they can no longer sign in to the workspace. [`reactivate`](#reactivate-a-user) brings them back with the same role. Deactivating a former member is not an error.

**uid** `str` *required*

The user's uid.

**workspace\_uid** `Optional[str]` (default: None)

The workspace to change, for a company API key.

**Returns** `AdminUser`

The user, now `DEACTIVATED`.

```python theme={"system"}
paradime.admin.users.deactivate("USER_UID")
```

## Reactivate a user

Brings a former member back with the role they had. Reactivating an active user is not an error.

**uid** `str` *required*

The user's uid.

**workspace\_uid** `Optional[str]` (default: None)

The workspace to change, for a company API key.

**Returns** `AdminUser`

The user, `ACTIVE` again.

```python theme={"system"}
paradime.admin.users.reactivate("USER_UID")
```

## Read auto-join domains

Reads the email domains whose users join the workspace on sign-up. See [Enable auto-join](https://docs.paradime.io/products/settings/users/enable-auto-join.md).

**workspace\_uid** `Optional[str]` (default: None)

The workspace to read, for a company API key.

**Returns** `List[str]`

The domains, lowercase and sorted. Empty when auto-join is off.

```python theme={"system"}
print(paradime.admin.users.get_auto_join_domains())
```

## Set auto-join domains

Replaces the workspace's auto-join domains. An empty list turns auto-join off.

**domains** `Sequence[str]` *required*

Email domains, such as `example.com`. Paradime matches them in lowercase.

**workspace\_uid** `Optional[str]` (default: None)

The workspace to change, for a company API key.

**Returns** `List[str]`

The domains now set.

```python theme={"system"}
paradime.admin.users.set_auto_join_domains(["example.com"])
```

## Types

Import the model and enums from `paradime.apis.admin.users.types`.

**AdminUser** `model`

**fields**

**email** `Optional[str]`

The user's email, or the invitee's.

**uid** `Optional[str]`

The user's uid, as `update`, `deactivate` and `reactivate` take it. `None` for an invitee.

**full\_name** `Optional[str]`

The user's name, when known.

**account\_type** `Optional[UserAccountType]`

The user's role in the workspace: the role a deactivated user had, or the role an invitation gives.

**status** `UserStatus`

`ACTIVE` (a member who can sign in), `INVITED` (invited by email, not signed up yet) or `DEACTIVATED` (a former member).

**invite\_status** `Optional[UserInviteStatus]`

`PENDING` while the invitation link works, `EXPIRED` when it no longer does. `None` unless `INVITED`.

**invited\_at** `Optional[datetime]`

When the latest invitation was sent. `None` unless `INVITED`.

**last\_login\_at** `Optional[datetime]`

When the user last signed in. `None` for an invitee.

### Roles

`UserAccountType` values and the roles they stand for in Paradime. See [Roles and permissions](https://docs.paradime.io/products/settings/users/roles-and-permissions.md).

| Value | Role |
| - | - |
| `ADMIN` | Admin |
| `DEVELOPER` | Developer |
| `BUSINESS` | Business |
| `ANALYST` | Analyst |
| `WORKSPACE_ADMIN` | Workspace Admin |
| `WORKSPACE_SETTINGS_ADMIN` | Workspace Settings Admin |
| `BILLING_ADMIN` | Billing Admin |
| `SECURITY_ADMIN` | Security Admin |
| `SANDBOX_USER` | Sandbox User. The API never gives this role. |


## Related topics

- [Admin client](https://docs.paradime.io/developers/python-sdk/modules/admin/index.md)
- [Admin client: notifications](https://docs.paradime.io/developers/python-sdk/modules/admin/notifications.md)
- [Admin client: integrations](https://docs.paradime.io/developers/python-sdk/modules/admin/integrations.md)
- [Admin client: warehouse connections](https://docs.paradime.io/developers/python-sdk/modules/admin/connections.md)
- [Admin client: workspaces](https://docs.paradime.io/developers/python-sdk/modules/admin/workspaces.md)


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