User groups support adding or removing users in bulk from Projects, Datasets, and Ontologies within your Organization.

Create user groups using the Encord platform.

List user groups

Listing user groups returns a list of all user group names.

List all user groups in your Organization

You can list all users groups that currently exist within your Organization.

In the following script, ensure that you replace <private_key_path> with the path to your private key.

# Import dependencies
from encord.user_client import EncordUserClient

# Authenticate using the path to your private key. Replace \<private_key_path> with the path to your private key.
user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path="<private_key_path>"
    )

# List all groups for the Org your user belongs to
user_client.list_groups()

List user groups for Projects / Datasets / Ontologies

You can list all existing user groups for a specific Project. In the following script, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • If you are using the Project script, replace <project_hash> with the hash of the Project you want to list user groups for.
  • If you are using the Dataset script, replace <dataset_hash> with the hash of the Dataset you want to list user groups for.
  • If you are using the Ontology script, replace <ontology_hash> with the hash of the Ontology you want to list user groups for.

Add user groups

User groups can be added to Projects, Datasets, and Ontologies.

Add user group to Projects

Use the following scripts to add user groups to a Project.

In the following scripts, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • Replace <project_hash> with the hash of the Project you want to add a user group to.
  • Replace <group_name1> and <group_name2> with the name of the user group(s) you want to add to the Project. You can add one or multiple groups to a Project at once.

The different tabs show how to assign different user roles to the user group being added.

Add user group to Datasets

User groups can be added to Datasets.

In the following scripts, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • Replace <dataset_hash> with the hash of the Dataset you want to add a user group to.
  • Replace <group_name1> and <group_name2> with the name of the user group(s) you want to add to the Dataset. You can add one or multiple groups to a Dataset at once.

The different tabs show how to assign different roles to the user group being added to the Dataset.

Add user group to Ontologies

Use the following scripts to add user groups to Ontologies.

In the following scripts, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • Replace <ontology_hash> with the hash of the Ontology you want to add a user group to.
  • Replace <group_name1> and <group_name2> with the name of the user group(s) you want to add to the Ontology. You can add one, or multiple groups to an Ontology at once.

The different tabs show how to assign different roles to the user group being added to the Ontology.

Remove user groups from Projects / Datasets / Ontologies

User groups can be removed from Projects, Datasets, and Ontologies individually, or in bulk.

Admins can not be removed from Projects, Datasets, or Ontologies. To remove an Admin, contact support@encord.com

In the following scripts, ensure that you:

  • Replace <private_key_path> with the path to your private key.
  • If using the Project script, replace <project_hash> with the hash of the Project you want to remove user groups from.
  • If using the Dataset script, replace <dataset_hash> with the hash of the Dataset you want to remove user groups from.
  • If using the Ontology script, replace <ontology_hash> with the hash of the Ontology you want to remove user groups from.
  • Replace <group_name1> and <group_name2> with the name of the user group(s) you want to remove from the Project. You can remove one, or multiple groups from a Project at once.