Administer teams
Back to home
On this page
Organizations on Upsun are made up of both projects and users. While organizations by themselves allow you to assign project and environment type permissions to individual users on individual projects, having many users and many projects calls for another method to group common access control settings.
Teams provide a grouping that connects a subset of an organization’s users to a another subset of that organization’s projects. That relationship enables organization owners to set default Project and environment type access settings for each user and project from one place.
There is no limit to the number of teams that can be defined within a single organization.
Beta
You will notice that the CLI commands below for managing teams don’t include well defined subcommands specific to those actions.
Instead, the examples that follow interact with the Upsun API directly via the authenticated api:curl command.
This will change.
Create a new team
As an organization owner or member with Manage users permissions, you can create new teams.
Teams must belong to an organization, so create one first. You can create new organizations with different payment methods and billing addresses and organize your projects as you want, but keep in mind that both users and teams are restricted to single organizations.
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Click + Create team.
- Enter the information for your team. Only the team name is required at this point, but you can define environment type permissions now if you’d like.
- Click Create team.
Assuming you have already created the organization deploy-friday-agency,
ORGANIZATION=deploy-friday-agencyretrieve that ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)Then use that ORGANIZATION_ID to create a new team for your organization’s “Frontend developers” by running:
upsun api:curl -X POST /teams \
-d '{"organization_id": "'"$ORGANIZATION_ID"'", "label": "Frontend Developers"}'That command will provide a TEAM_ID, which you can use to verify the team was created successfully:
upsun api:curl -X GET /teams/$TEAM_IDTip
You can retrieve the TEAM_ID during team creation using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X POST /teams \
-d '{"organization_id": "'"$ORGANIZATION_ID"'", "label": "Frontend Developers"}' | jq -r '.id') Delete an existing team
As an organization owner or member with Manage users permissions, you can delete existing teams.
Note that deleting teams and deleting users are not equivalent. Deleting a team will remove member access permissions to projects described by the team, but it will not remove users from the organization (or your billing).
- Navigate to your existing organization
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Delete team.
- Click Yes to confirm.
To delete the team Frontend developers from the organization deploy-friday-agency, first retrieve the ORGANIZATION_ID.
Assuming you have already created the organization deploy-friday-agency,
ORGANIZATION=deploy-friday-agencyretrieve that ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)You can then use that ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET "/teams?filter[organization_id]=$ORGANIZATION_ID"The response will include a TEAM_ID for the team Frontend developers.
Use that ID to delete the team:
upsun api:curl -X DELETE /teams/$TEAM_IDTip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Manage team settings
As an organization owner or member with Manage users permissions, you can manage the settings of existing teams such as:
- It’s name
- The environment type permissions granted to members on individual projects
- Team members
- Project access
Team name
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Edit team.
- In the sidebar click the Edit link, and edit the team name.
- Click Save.
To change the name of the team Frontend developers (organization deploy-friday-agency) to JS developers, first retrieve the ORGANIZATION_ID.
Assuming you have already created the organization deploy-friday-agency,
ORGANIZATION=deploy-friday-agencyretrieve that ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)You can then use that ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET "/teams?filter[organization_id]=$ORGANIZATION_ID"The response will include a TEAM_ID for the team Frontend developers.
Use that ID to update the team name:
upsun api:curl -X PATCH "/teams/$TEAM_ID" -d '{"label": "JS Developers"}' Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Project & environment type permissions
The primary purpose of teams is to allow organizations to quickly apply, audit, and update project and environment type permissions for groups of users.
-
Navigate to your existing organization
-
Open the user menu (your name or profile picture).
-
Select Teams from the dropdown.
-
Find the team you want to delete under the Manage teams list, then click More.
-
Click Edit team.
-
In the sidebar, you can:
- Assign Project permissions by selecting the check box to make team members Project admins of every project added to the team.
- Assign Environment type permissions by using the dropdowns to grant No access, Viewer, Contributor, or Admin rights to team members for Production, Staging, and Development project environment types.
-
Click Save.
To update or set project and environment type permissions for the team Frontend developers (organization deploy-friday-agency),
ORGANIZATION=deploy-friday-agencyfirst retrieve the ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)You can then use that $ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET "/teams?filter[organization_id]=$ORGANIZATION_ID"The response will include a TEAM_ID for the team Frontend developers.
Use that ID to update the team’s project and environment type permissions:
upsun api:curl -X PATCH "/teams/$TEAM_ID" \
-d '{
"project_permissions": [
"viewer",
"production:viewer",
"staging:contributor",
"development:contributor"
]
}' In the example above, any user added to the Frontend Developers team will have:
- A viewer project role (rather than admin)
- Environment roles that will provide viewer access to production environment types, and contributor access to staging and development environment types
for all projects the team has been added to.
Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Team members
Add users to a team
To join a team, a user must already have been added to the organization, where their organization permissions are defined.
Note
If you add a viewer to a team with permissions belonging to a paid user license, the user will be charged as a paid user.
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Add user.
- Locate and select organization users from the dropdown.
- In the sidebar click the Edit link, and edit the team name.
- Click Add users.
To add a user to the team Frontend developers (organization deploy-friday-agency),
ORGANIZATION=deploy-friday-agencyfirst retrieve the ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)Also find a USER_ID for the user you want to add to the team from their email by running the command:
USER_ID=$(upsun organization:user:get -o $ORGANIZATION $USER_EMAIL -P id)You can use the ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET "/teams?filter[organization_id]=$ORGANIZATION_ID"The response will include a TEAM_ID for the team Frontend developers.
With all of this info, you can now add a user to the team Frontend developers:
upsun api:curl -X POST "/teams/$TEAM_ID/members" -d '{"user_id": "'"$USER_ID"'"}' Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Remove users from a team
Note that deleting users from teams and deleting users from organizations are not equivalent. Deleting users from a team will remove member access permissions to projects described by the team, but it will not remove users from the organization (or your billing).
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Edit team.
- Find the user you want to delete under the USERS tab view, then click More.
- Click Remove user.
- Click Yes to confirm.
To remove a user from the team Frontend developers (organization deploy-friday-agency),
ORGANIZATION=deploy-friday-agencyfirst retrieve the ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)You can use the ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET "/teams?filter[organization_id]=$ORGANIZATION_ID"The response will include a TEAM_ID for the team Frontend developers.
You can use that ID to list the members of that team:
upsun api:curl -X GET "/teams/$TEAM_ID/members"Find a USER_ID for the user you want to remove from the team from their email by running the command:
USER_ID=$(upsun organization:user:get -o $ORGANIZATION $USER_EMAIL -P id)That response will list all members, including the USER_ID for the user you want to remove. To remove them, run:
upsun api:curl -X DELETE "/teams/$TEAM_ID/members/$USER_ID" Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Team access to projects
Adding projects to a team’s access
Option 1: Add projects to team with from Team settings
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Edit team.
- Click + Add projects.
- Select All projects, or choose individual projects from the dropdown.
- Click Add to team.
Option 2: Add teams to project from project’s Access settings
- Navigate to your existing organization.
- Click on the project you want to add to the existing team.
- Navigate to the projects settings by clicking the Settings icon.
- Click on Access settings under Project settings in the sidebar.
- Click on the TEAMS tab in the Access list view.
- Click +Add to projects.
- Select All teams, or choose individual teams from the dropdown.
- Click Add to team.
To add the team Frontend developers (organization deploy-friday-agency) to the project Django Commerce,
ORGANIZATION=deploy-friday-agencyfirst retrieve the ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)Locate the PROJECT_ID as well by running:
PROJECT_ID=$(upsun project:list --pipe --title="Django Commerce" -o $ORGANIZATION)You can use the ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET '/teams?filter[organization_id]=ORGANIZATION_ID'The response will include a TEAM_ID for the team Frontend developers.
With all of this information in hand, grant the team access to the project:
Option 1: Add team to the project
upsun api:curl -X POST "/projects/$PROJECT_ID/team-access" \
--json '[{"team_id": "'"$TEAM_ID"'"}]' Option 2: Add project to the team
upsun api:curl -X POST "/teams/$TEAM_ID/project-access" \
--json '[{"project_id": "'"$PROJECT_ID"'"}]' Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id') Remove project from team’s access
Option 1: Remove projects from a team with from Team settings
- Navigate to your existing organization.
- Open the user menu (your name or profile picture).
- Select Teams from the dropdown.
- Find the team you want to delete under the Manage teams list, then click More.
- Click Edit team.
- Find the project you want to modify under the PROJECTS tab view, then click More.
- Click Remove project.
- Select All projects, or choose individual projects from the dropdown.
- Click Yes to confirm.
Option 2: Remove teams from a project from project’s Access settings
- Navigate to your existing organization.
- Click on the project you want to add to the existing team.
- Navigate to the projects settings by clicking the Settings icon.
- Click on Access settings under Project settings in the sidebar.
- Find the team under the TEAMS tab view, then click More.
- Click Remove team.
- Click Yes to confirm.
To remove the team Frontend developers (organization deploy-friday-agency) from the project Django Commerce,
ORGANIZATION=deploy-friday-agencyfirst retrieve the ORGANIZATION_ID with the command:
ORGANIZATION_ID=$(upsun organization:info -o $ORGANIZATION id)Locate the PROJECT_ID as well by running:
PROJECT_ID=$(upsun project:list --pipe --title="Django Commerce" -o $ORGANIZATION)You can use the ORGANIZATION_ID to list the teams associated with it:
upsun api:curl -X GET '/teams?filter[organization_id]=ORGANIZATION_ID'The response will include a TEAM_ID for the team Frontend developers.
With all of this information in hand, remove the team’s access to the project:
Option 1: Remove team from the project
upsun api:curl -X DELETE "/projects/$PROJECT_ID/team-access/$TEAM_ID"Option 2: Remove project from the team
upsun api:curl -X DELETE "/teams/$TEAM_ID/project-access/$PROJECT_ID"Tip
You can retrieve the TEAM_ID using a tool like jq.
For example,
TEAM_ID=$(upsun api:curl -X GET \
"/teams?filter[organization_id]=$ORGANIZATION_ID" \
| jq -r '.items | to_entries[] | select(.value.label == "Frontend Developers") | .value.id')