Team invites

Appwrite provides two approaches for adding members to teams: client-side email invites and server-side custom flows. Each approach serves different use cases and offers unique benefits.

Invite client-side

Client-side email invites are perfect for implementing user-to-user invitations, allowing your users to invite others to join their teams, organizations, or shared resources. When creating a membership, Appwrite:

  1. Creates a new user account if one doesn't exist for the email address

  2. Sends an automated email invitation to the user

  3. Creates a pending membership

  4. Activates the membership when the user accepts

Client-side invites are ideal when you want a simple, automated process that lets your users manage their own team invitations. Appwrite handles the email delivery with built-in templates and localization support, making it easy to implement a standard invite acceptance flow with email verification.

Accept invitations

For client-side email invites, users must accept the invitation to join the team. The acceptance flow:

  1. User receives an email with an invitation link containing a secret token

  2. Clicking the link redirects to your app

  3. Your app calls the acceptance endpoint

  4. Upon success, the user gains immediate access

Server-side custom flows

Server-side membership creation bypasses the email invitation process, allowing direct member addition. This approach:

  1. Creates an active membership immediately

  2. Doesn't require user acceptance

  3. Gives you complete control over the invitation workflow

This makes them perfect for scenarios requiring custom workflows, such as bulk user management, automated team assignments, or integration with external systems. Since memberships are created directly, users gain immediate access without waiting for email acceptance.

Manage memberships

Once team memberships are created, you'll need to manage their lifecycle. This includes checking status, updating roles, and removing members when necessary.

Check membership status

Before performing actions on team memberships, you often need to verify a user's current status within a team. The process differs between client-side and server-side implementations.

Client-side

To check membership status client-side, first list the teams and then get the memberships for a specific team:

Server-side

Server-side requires iterating through teams and memberships since the data isn't filtered for a specific user:

Remove members

Team owners can remove members or users can leave teams:

Manage team permissions

Teams in Appwrite use a role-based access control (RBAC) system. Each team member can be assigned one or more roles that define their permissions within the team.

Update roles

You can assign roles when creating a membership or update them later. Note that only team members with the owner role can update other members' roles:

Check role access

You can verify if a user has specific roles:

See how to grant document and file access to team roles in the permissions guide.

Learn more about team management