Skip to main content
Module

x/appwrite/mod.ts>Teams

[READ-ONLY] Official Appwrite Deno SDK 🦕
Go to Latest
class Teams
extends Service
Re-export
import { Teams } from "https://deno.land/x/appwrite@1.0.0/mod.ts";

Methods

create(name: string, roles?: string[]): Promise<Models.Team>

Create Team

Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.

createMembership(
teamId: string,
email: string,
roles: string[],
url: string,
name?: string,
): Promise<Models.Membership>

Create Team Membership

Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.

Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the Update Team Membership Status endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.

Please note that in order to avoid a Redirect Attacks the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.

delete(teamId: string): Promise<Response>

Delete Team

Delete a team by its unique ID. Only team owners have write access for this resource.

deleteMembership(teamId: string, membershipId: string): Promise<Response>

Delete Team Membership

This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.

get(teamId: string): Promise<Models.Team>

Get Team

Get a team by its unique ID. All team members have read access for this resource.

getMemberships(
teamId: string,
search?: string,
limit?: number,
offset?: number,
orderType?: string,
): Promise<Models.MembershipList>

Get Team Memberships

Get a team members by the team unique ID. All team members have read access for this list of resources.

list(
search?: string,
limit?: number,
offset?: number,
orderType?: string,
): Promise<Models.TeamList>

List Teams

Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. Learn more about different API modes.

update(teamId: string, name: string): Promise<Models.Team>

Update Team

Update a team by its unique ID. Only team owners have write access for this resource.

updateMembershipRoles(
teamId: string,
membershipId: string,
roles: string[],
): Promise<Models.Membership>

Update Membership Roles

updateMembershipStatus(
teamId: string,
membershipId: string,
userId: string,
secret: string,
): Promise<Models.Membership>

Update Team Membership Status

Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email recieved by the user.