Docs
Skip to content

Auth

Teams_

Master team management in the Appwrite Cloud. Explore team-related functions, permissions, and more.

2 min read

Raw

Teams are a good way to allow users to share access to resources. For example, in a todo app, a user can create a team for one of their todo lists and invite another user to the team to grant the other user access. You can further give special rights to parts of a team using team roles.

The invited user can accept the invitation to gain access. If the user's ever removed from the team, they'll lose access again.

Create team

For example, we can create a team called teachers with roles maths, sciences, arts, and literature.

The creator of the team is also granted the owner role. Only those with the owner role can invite and remove members.

Invite a member

You can invite members to a team by creating team memberships. For example, inviting "David" a math teacher, to the teachers team.

Using the CLI

Use the CLI command appwrite teams create-membership [options] to invite a new member into your team.

Bash
appwrite teams create-membership --team-id "<TEAM_ID>" --roles --phone "+12065550100" --name "<NAME>" --user-id "<USER_ID>"

You can also get, update, and delete a user's membership. However, you cannot use the CLI to configure permissions for team members.

Permissions

You can grant permissions to all members of a team using the Role.team(<TEAM_ID>) role or individual roles in the team using the Role.team(<TEAM_ID>, [<ROLE_1>, <ROLE_2>, ...]) role.

DescriptionRole
All membersRole.team(<TEAM_ID>)
Select rolesRole.team(<TEAM_ID>, [<ROLE_1>, <ROLE_2>, ...])

Memberships privacy

In certain use cases, your app may not need to share members' personal information with others. You can safeguard privacy by marking specific membership details as private. To configure this setting, navigate to Auth > Security > Memberships privacy

These details can be made private:

  • userName - The member's name
  • userEmail - The member's email address
  • mfa - Whether the member has enabled multi-factor authentication

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.