Create Team
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/teams
Description
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
Required scopes
Authentication
setProject() and a server API key (setKey()), or authenticate as a signed-in user (setSession() or setJWT()). For direct REST calls, send X-Appwrite-Project with either X-Appwrite-Key or session/JWT headers.Parameters
Team ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Team name. Max length: 128 chars.
Array of strings. Use this param to set the roles in the team for the user who created it. The default role is owner. A role can be any string. Learn more about roles and permissions. Maximum of 100 roles are allowed, each 32 characters long.
Team
Team ID.
Team creation date in Unix timestamp.
Team update date in Unix timestamp.
Team name.
Total number of team members.
import io.appwrite.Clientimport io.appwrite.services.Teams
public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
Teams teams = new Teams(client); teams.create( teamId = "[TEAM_ID]", name = "[NAME]", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; }
@Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } );}Teams
Create Team
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/teams
Description
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
Required scopes
Authentication
setProject() and a server API key (setKey()), or authenticate as a signed-in user (setSession() or setJWT()). For direct REST calls, send X-Appwrite-Project with either X-Appwrite-Key or session/JWT headers.Parameters
Team ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Team name. Max length: 128 chars.
Array of strings. Use this param to set the roles in the team for the user who created it. The default role is owner. A role can be any string. Learn more about roles and permissions. Maximum of 100 roles are allowed, each 32 characters long.
Team
Team ID.
Team creation date in Unix timestamp.
Team update date in Unix timestamp.
Team name.
Total number of team members.
import io.appwrite.Clientimport io.appwrite.services.Teams
public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
Teams teams = new Teams(client); teams.create( teamId = "[TEAM_ID]", name = "[NAME]", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; }
@Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } );}