# Teams

Teams group organization members for ownership, attribution, and shared governance. Budgets, rate limit policies, and MCP access can use the team identity to control traffic from team-bound caller API keys. A team can also hold [roles](https://docs.api7.ai/ai-gateway/cloud/custom-roles.md) that every member of the team receives.

Team membership and caller API key binding serve different purposes. The roster identifies who belongs to the team. Traffic counts toward team controls only when the caller API key used for the request is explicitly bound to that team.

## Create a Team[​](#create-a-team "Direct link to Create a Team")

1. Open **Teams** and select **New team**.
2. Enter a **Display name** and an optional **Description**.
3. Select **Create team**.

The team appears with its member count and **Team ID**. Select the team name or **Manage** to open its detail page.

Copy the Team ID when another guide requires `TEAM_ID`. The same UUID appears at the end of the team detail page URL.

```
export TEAM_ID="YOUR_TEAM_ID"
```

## Add and Manage Members[​](#add-and-manage-members "Direct link to Add and Manage Members")

Team members come from the organization member pool. [Create or invite the member](https://docs.api7.ai/ai-gateway/cloud/members.md) before adding them to a team.

1. Open the team detail page.
2. Under **Members**, select **Add member**.
3. Select the **Org member** and assign the team role **Member** or **Lead**.
4. Select **Add member**.

The Member and Lead labels belong to the team roster. They are not organization roles, although a role can use them: the **teams I lead** assignment covers every API key bound to a team the member leads. When a team has one lead, promote another member before demoting or removing the only lead.

Use the role selector on a member row to change their team role. Select the remove action to remove the member from the team without removing their organization membership.

Changing a team's members takes `update` permission on that team. Because the team's members hold its roles, see [Give a Team Roles](#give-a-team-roles) before granting it.

## Give a Team Roles[​](#give-a-team-roles "Direct link to Give a Team Roles")

Starting with control plane 1.11.0, a team can hold roles. Every member of the team holds them for as long as they are on it, in addition to their own roles. Use team roles to give a department, or a directory group synced as a team, the same access.

1. Open the team detail page.
2. In the **Team roles** card, choose a role from **Pick a role…** and select **Add role**.
3. To take a role away, select **Remove role** next to it.

The **Teams** list shows each team's roles, and the **Members** page shows a member's team roles under **Via teams**. Every role except Owner can be given to a team.

Two permissions decide who can change what a team grants:

* Adding and removing team roles takes `role_assignments`, which only owners hold by default.
* Adding someone to the team, or removing them, takes `teams` `update` on that team. Whoever can change a team's members can therefore hand the team's roles to anyone. Grant `teams` `update` only on teams whose roles you would also let that person assign. The role editor warns when a rule updates teams.

## Manage Teams with the Admin API[​](#manage-teams-with-the-admin-api "Direct link to Manage Teams with the Admin API")

The AISIX Cloud Admin API supports the same team lifecycle and roster operations:

| Task                                             | Method and path                                        |
| ------------------------------------------------ | ------------------------------------------------------ |
| List or create teams                             | `GET` or `POST /teams`                                 |
| Inspect, update, or delete a team                | `GET`, `PATCH`, or `DELETE /teams/{team_id}`           |
| List or add members                              | `GET` or `POST /teams/{team_id}/members`               |
| Change a member's team role or remove the member | `PATCH` or `DELETE /teams/{team_id}/members/{user_id}` |
| List or add team roles                           | `GET` or `POST /teams/{team_id}/roles`                 |
| Remove a team role                               | `DELETE /teams/{team_id}/roles/{role_name}`            |

`GET /teams/{team_id}/members` accepts optional `q`, `page`, and `page_size` with the same meaning as on [`GET /members`](https://docs.api7.ai/ai-gateway/cloud/members.md#list-members-with-the-api). Without `page_size` it returns the whole roster in `data`, and with `page_size` the response adds `total`, `page`, and `page_size`. Each row carries `id`, the organization membership ID that caller API key owners and budgets refer to. Each team in `GET /teams` carries its `roles`. `POST /teams/{team_id}/roles` takes `{"role": "ROLE_NAME"}`, and giving a team the owner role returns `400`.

The membership item path uses the member's account `user_id`, not the organization membership ID used for caller-key attribution. Team entitlements are available through `/teams/{team_id}/entitlements`. These operations require the applicable admin-token scope and organization permissions. See the [AISIX Enterprise / Cloud Admin API](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api.md) for request and response schemas.

## Bind Caller API Keys to the Team[​](#bind-caller-api-keys-to-the-team "Direct link to Bind Caller API Keys to the Team")

Team membership alone does not attribute traffic to the team. Bind each caller API key that should use team budgets, rate limits, or MCP access:

1. Open the environment and select **API keys**.
2. Create a key with **New API key**, or edit an existing key.
3. Select the team in **Team**.
4. Optionally select an **Owner**. After choosing a team, the owner list contains only members of that team.
5. Create the key or save the changes.

The API key row shows its team binding. A member's personal key does not count toward a team merely because that member appears on the roster.

Binding a key to a team, or moving it to another team, applies to the key's later requests. Spend already counted toward the previous team's budget stays there. See [How Spend Is Counted](https://docs.api7.ai/ai-gateway/traffic-controls/budgets.md#how-spend-is-counted).

## Configure Team Controls[​](#configure-team-controls "Direct link to Configure Team Controls")

The team detail page provides **Team budget (shared)**, **Per-member budget**, and **MCP entitlement** controls. Related guides cover the complete behavior:

* [Budgets](https://docs.api7.ai/ai-gateway/traffic-controls/budgets.md) explains shared team budgets and separate allowances for each member in a team.
* [Rate Limit Policies](https://docs.api7.ai/ai-gateway/traffic-controls/rate-limit-policies.md) shows how to match a team and divide its quota into per-member buckets.
* [MCP Access Policies](https://docs.api7.ai/ai-gateway/mcp-gateway/access-policies.md#grant-a-team-policy) configures the MCP tools reachable by team-bound keys.

A team can also carry [cost attribution tags](https://docs.api7.ai/ai-gateway/cloud/cost-attribution-tags.md), set in its create and edit forms or with `tags` on `POST /teams` and `PATCH /teams/{team_id}`. A request through a team-bound caller API key takes the team's value for every tag the key does not set itself and that [a JWT claim](https://docs.api7.ai/ai-gateway/cloud/cost-attribution-tags.md#read-tags-from-jwt-claims) does not supply.

## Sync Teams from an Identity Provider[​](#sync-teams-from-an-identity-provider "Direct link to Sync Teams from an Identity Provider")

[SCIM directory sync](https://docs.api7.ai/ai-gateway/cloud/scim-directory-sync.md) represents an identity provider group as a team with the same name. Group membership changes update the team roster automatically. Manage the roster of a directory-synced team in the identity provider so later synchronization does not overwrite dashboard changes.

Directory-synced teams can use the same caller API key bindings, budgets, rate limit policies, MCP entitlements, and team roles as teams created in the dashboard. Give a synced team roles to give them to every member of the directory group; see [Assign Roles to Synced Members](https://docs.api7.ai/ai-gateway/cloud/scim-directory-sync.md#assign-roles-to-synced-members).

## Edit or Delete a Team[​](#edit-or-delete-a-team "Direct link to Edit or Delete a Team")

Open the team detail page and select **Edit** to change its display name, description, or tags. Select **Delete** to remove the team and its roster. The people on that roster remain organization members. The team's budget, its each-member-in-a-team budget, and the [classic rate limit policies](https://docs.api7.ai/ai-gateway/traffic-controls/rate-limit-policies.md#manage-classic-single-scope-policies) scoped to the team are deleted with it, and the confirmation lists them by name.

## Next Steps[​](#next-steps "Direct link to Next Steps")

Continue with [Caller API Keys](https://docs.api7.ai/ai-gateway/traffic-controls/caller-api-keys.md) to create team-bound credentials. Then configure [Budgets](https://docs.api7.ai/ai-gateway/traffic-controls/budgets.md), [Rate Limit Policies](https://docs.api7.ai/ai-gateway/traffic-controls/rate-limit-policies.md), or [MCP Access Policies](https://docs.api7.ai/ai-gateway/mcp-gateway/access-policies.md) for the team.
