Teams & roles

Teams group users and drive permissions. Grant access to a whole team, or to a role within it, using the team:TEAM_ID and team:TEAM_ID/role permission roles.

Create a team and add members

curl
curl -X POST "https://base.finiteskills.com/v1/teams" -H "X-Appwrite-Project: <YOUR_PROJECT_ID>" \
  -H "X-Appwrite-Key: <API_KEY>" -H "Content-Type: application/json" \
  -d '{"teamId":"unique()","name":"Acme"}'

# Add a member with roles (v1 adds by userId; no invite email step)
curl -X POST "https://base.finiteskills.com/v1/teams/TEAM_ID/memberships" -H "X-Appwrite-Project: <YOUR_PROJECT_ID>" \
  -H "X-Appwrite-Key: <API_KEY>" -H "Content-Type: application/json" \
  -d '{"userId":"USER_ID","roles":["admin"]}'

Using teams in permissions

Permission examples
read("team:TEAM_ID")          // any member
update("team:TEAM_ID/admin")  // members with the "admin" role

A request from a signed-in user automatically carries their team memberships, so these permissions are evaluated on every read/write.