Teams
The active team, the teams the viewer belongs to, team settings, ownership and the MCP switch.
Every request acts in exactly one team. viewerTeam says which. A session picks it with switchTeam; an API token picks it with the X-Deplo-Team header (see Authentication).
Reading
viewerTeam
Any signed-in principal. Returns Team.
The active team.
query {
viewerTeam {
id
slug
name
requireTwoFactor
}
}myTeams
Any signed-in principal. Returns [TeamMembership!].
Every team the viewer belongs to, for the team switcher.
query {
myTeams {
id
slug
name
role
}
}Creating and switching
reorderMyTeams is personal, like the rest of Account: an API token cannot call it.
createTeam
Any signed-in principal. Returns Team.
Create a new team; the viewer becomes its owner and it is made active.
| Argument | Type | Description |
|---|---|---|
image | String | |
name | String! |
mutation {
createTeam(name: "shop") {
id
slug
name
requireTwoFactor
}
}switchTeam
Any signed-in principal. Returns Boolean.
Switch the active team (sets a cookie server-side). Returns true.
| Argument | Type | Description |
|---|---|---|
teamId | String! |
mutation {
switchTeam(teamId: "team_9f1c2ab7d3e4f5a6")
}reorderMyTeams
Any signed-in principal. Returns Boolean.
Set the current user's own order for the topbar team switcher, first to last. Personal, never team-wide: nobody else's list moves. Ids the user is not a member of are ignored, and any team left out of the list keeps its place at the end. Returns true.
| Argument | Type | Description |
|---|---|---|
teamIds | [String!]! |
mutation {
reorderMyTeams(teamIds: ["team_9f1c2ab7d3e4f5a6", "team_0a1b2c3d4e5f6a7b"])
}Settings
updateTeam
Needs manage_team. Returns Team.
Rename the team, or require two-factor authentication from every member.
| Argument | Type | Description |
|---|---|---|
input | UpdateTeamInput! | |
input.name | String | |
input.requireTwoFactor | Boolean |
mutation {
updateTeam(input: { name: "Acme", requireTwoFactor: true }) {
id
slug
name
requireTwoFactor
}
}updateTeamAvatar
Needs manage_team. Returns Team.
Set or clear the active team's picture. Same gate as renaming the team, because it IS the same action - how the team presents itself. The value is a base64 image data-URI (png/jpeg/webp); null or empty removes it and falls back to the two-letter monogram.
| Argument | Type | Description |
|---|---|---|
image | String |
mutation {
updateTeamAvatar(image: "data:image/png;base64,…") {
id
slug
name
requireTwoFactor
}
}Ownership and deletion
transferTeamOwnership
Needs manage_team. Returns Boolean.
Hand the active team to another member, who is put on the Owner role with the whole team in reach as part of the same write. Primary-owner only; requires the caller's password, plus a two-factor code when their account has 2FA on. Returns true.
| Argument | Type | Description |
|---|---|---|
code | String | |
password | String! | |
userId | String! |
mutation {
transferTeamOwnership(userId: "user_9f1c2ab7d3e4f5a6", password: "correct-horse-battery-staple")
}deleteTeam
Any signed-in principal. Returns Boolean.
Permanently delete a team. teamId must be the ACTIVE team (the delete fails closed if the active team changed since the page was loaded). Removes every team-scoped record; the app/database stack teardown continues in the background. Founder or instance admin only; the caller's last team can't be deleted. Returns true.
| Argument | Type | Description |
|---|---|---|
teamId | String! |
mutation {
deleteTeam(teamId: "team_9f1c2ab7d3e4f5a6")
}MCP
Whether AI agents may act in this team over MCP. The wire protocol is on MCP.
mcpSettings
Any signed-in principal. Returns McpSettings.
The active team's MCP policy.
query {
mcpSettings {
enabled
}
}setMcpSettings
Needs manage_team. Returns McpSettings.
Turn MCP access on or off for this team - a team setting, so it needs manage_team.
| Argument | Type | Description |
|---|---|---|
enabled | Boolean! |
mutation {
setMcpSettings(enabled: true) {
enabled
}
}mcpTeams
Any signed-in principal. Returns [McpTeam!].
Every team the caller's credential can name, and whether MCP may act in each: the team's switch and the caller's manage_mcp there.
query {
mcpTeams {
id
slug
mcpEnabled
canConnect
}
}mcpAgentCount
Any signed-in principal. Returns Int.
How many AI agents can act in this team over MCP, every member's counted. A number only: tokens are personal and never listed to anyone but their owner.
query {
mcpAgentCount
}mcpConnected
Any signed-in principal. Returns Boolean.
Has this API token spoken MCP yet? What the connect wizard waits on before saying an agent is really connected.
| Argument | Type | Description |
|---|---|---|
tokenId | String! |
query {
mcpConnected(tokenId: "tok_9f1c2ab7d3e4f5a6")
}See also
Did this page help you?