Assign a team role with the APC API

The examples on this page show common ways to use the APC API — they’re not a complete API reference. For the full, interactive API documentation for your installation, including every available query, mutation, and type, go to https://houston.<your-base-domain>/v1, and click on the Docs tab. See Develop and test APC API queries for more on using the built-in GraphQL explorer.

Assign a team to a workspace

If you omit role, the team defaults to WORKSPACE_VIEWER.

1mutation {
2 workspaceAddTeam(
3 teamUuid: "<team-uuid>"
4 workspaceUuid: "<workspace-uuid>"
5 role: WORKSPACE_EDITOR
6 ) {
7 id
8 label
9 }
10}

Assign workspace and deployment roles in a single mutation:

1mutation {
2 workspaceAddTeam(
3 teamUuid: "<team-uuid>"
4 workspaceUuid: "<workspace-uuid>"
5 role: WORKSPACE_VIEWER
6 deploymentRoles: [
7 { deploymentId: "<deployment-uuid-1>", role: DEPLOYMENT_ADMIN }
8 { deploymentId: "<deployment-uuid-2>", role: DEPLOYMENT_EDITOR }
9 ]
10 ) {
11 id
12 }
13}

Assign a team to a Deployment

1mutation {
2 deploymentAddTeamRole(
3 teamUuid: "<team-uuid>"
4 deploymentUuid: "<deployment-uuid>"
5 role: DEPLOYMENT_EDITOR
6 ) {
7 id
8 role
9 }
10}

For the full teams model, roles, and error reference, see team management reference.