Adding users to projects

Users can be added to an existing project using their emails. You can specify the role of the users being added using the ProjectUserRole enum. You can find more details of the different roles here.

👍

Tip

The project hash can be found within the URL once a project has been selected:
app.encord.com/projects/view/<project_hash>/summary

👍

Tip

For collaborative teams using our SDK, we recommend creating shared service accounts and creating SSH keys for those shared accounts. For example, to have several people create ontologies, datasets, and projects programmatically, create an email account for use with Encord (for example, [email protected]) and generate an SSH for that email account.

Below is an example of how to add two new annotators to the project. Note how all users get assigned the same role.


# Import dependencies
from encord import EncordUserClient, Project
from encord.utilities.project_user import ProjectUserRole

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

# Specify the project you'd like to add users to
project = user_client.get_project("<project_hash>")

# Add users by specifying their email addresses, as well as the role these users should have.
added_users = project.add_users(
    ["[email protected]", "[email protected]"],
    ProjectUserRole.ANNOTATOR,
)

# Print the new users added to the project
print(added_users)