# User Management

## Overview

{% hint style="info" %}

* This feature is available with the [**Paradime Enterprise pack**](https://www.paradime.io/enterprise).&#x20;
* Your API keys ***must*** have either [User Management Admin or User Metadata Viewer capabilities](https://docs.paradime.io/app-help/developers/generate-api-keys).
  {% endhint %}

The User Management module enables you to efficiently administer and regulate user access within your workspace.&#x20;

This module offers a comprehensive set of tools to list all users, send invitations to new members, disable users' accounts, and precisely control users' roles and permissions.

## Get all active users

Retrieves all active users.

{% tabs %}
{% tab title="Args" %}
**`none`**
{% endtab %}

{% tab title="Returns" %}
*`List[ActiveUser]`*: A list of active user objects.
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Get all active users
active_users = paradime.users.list_active()
```

## Get a user by email

Retrieves a user by email.

{% tabs %}
{% tab title="Args" %}
**`email`** *`(str)`*: The email of the user to retrieve.
{% endtab %}

{% tab title="Returns" %}
*`ActiveUser`*: The user object.
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Get a user by email
user = paradime.users.get_by_email(email="john@acme.io")
```

## Get all invited users

Retrieves all invited users.

{% tabs %}
{% tab title="Args" %}
**`none`**
{% endtab %}

{% tab title="Returns" %}
*`List[InvitedUser]`*: A list of invited user objects.
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Get all invited users
invited_users = paradime.users.list_invited()
```

## Invite a user

Invites a user to the workspace.

{% tabs %}
{% tab title="Args" %}
**`email`** *`(str)`*: The email of the user to invite.

**`account_type`** *`(UserAccountType)`*: The account type of the user to invite.
{% endtab %}

{% tab title="Returns" %}
*`none`*
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime
from paradime.apis.users.types import UserAccountType

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Invite a user as an admin
paradime.users.invite(email="bhuvan@paradime.io", account_type=UserAccountType.ADMIN)

```

## Update a user's account type

Updates the account type of a user.

{% tabs %}
{% tab title="Args" %}
**`uid`** *`(str)`*: The ID of the user to update the account type for.

**`account_type`** *`(UserAccountType)`*: The new account type for the user.
{% endtab %}

{% tab title="Returns" %}
*`none`*
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime
from paradime.apis.users.types import UserAccountType

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Update a user's account type
paradime.users.update_account_type(user_uid=user.uid, account_type=UserAccountType.DEVELOPER)
```

## Disable a user

Disable a user in the workspace.

{% tabs %}
{% tab title="Args" %}
**`uid`** *`(str)`*: The ID of the user to disable.
{% endtab %}

{% tab title="Returns" %}
*`none`*
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Disable a user
paradime.users.disable(user_uid=user.uid)
```
