> ## Documentation Index
> Fetch the complete documentation index at: https://docs.member.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent chat: which teams can use it

> Agent chat is controlled by the agent_chat feature gate: off, chosen teams, or on. How the switch works and what a team that is off sees.

**Agent chat** is the AI assistant inside Membership.io: the chat panel in the platform admin and the AI tab in the hub editor. It edits your hubs and pages through the same tools as the [MCP server](https://docs.member.dev/guides/mcp.md).

Agent chat is **off for a team** until Membership.io staff turn it on for that team. It is controlled by the `agent_chat` [feature gate](https://docs.member.dev/reference/endpoint-inventory.md): `off`, `teams` (only the chosen teams) or `on` (every live team). This page explains the switch and what happens when a team is off. It is mostly useful if you support teams or test agent chat.

To gate a route, place `require_feature("feature_name")` after its access dependency so access is checked before an off feature returns `404`.

***

## The per-team switch

Each team has one setting, `agent_chat_enabled`: whether the team is one of the gate's chosen teams. It is `false` for a team that was never chosen. The gate itself (`/api/admin/feature-gates`) decides whether the chosen teams count: with the gate `off`, no team has agent chat; with `teams`, the chosen teams do; with `on`, every live team does. A deleted team never does.

Staff with the `platform_admin` role read and change it:

```http theme={null}
GET /api/v1/admin/teams/{team_id}/agent-chat-settings
Authorization: Bearer <platform admin JWT>
```

```http theme={null}
PATCH /api/v1/admin/teams/{team_id}/agent-chat-settings
Authorization: Bearer <platform admin JWT>
Content-Type: application/vnd.api+json

{
  "data": {
    "type": "team_agent_chat_settings",
    "id": "{team_id}",
    "attributes": { "agent_chat_enabled": true }
  }
}
```

Leaving `agent_chat_enabled` out changes nothing. Sending `null` is refused with `422`. An unknown or deleted team gets `404`. The response has `agent_chat_enabled` (is the team chosen) and `effective` (what the gate answers now).

API keys cannot use these routes. Every change is logged with the team id and the before and after values, and written to the gate's audit trail with the reason `agent-chat-settings route`.

From a server shell, staff can use the CLI instead. `<team>` is a team id or a team slug:

```bash theme={null}
mio agent-chat teams list          # every team that is on
mio agent-chat teams show <team>   # one team's setting
mio agent-chat teams on  <team>    # turn it on (one or more teams)
mio agent-chat teams off <team>    # turn it off
```

***

## What a team that is off sees

* **Platform admin:** no agent chat item in the rail, and no chat panel.
* **Hub editor:** the AI tab says "coming soon".
* **Text the agent (Account):** a note saying it isn't turned on for this team.

Calls made for a team that is off are refused:

| Call | Answer |
| - | - |
| Agent chat routes (`/api/agent-chat/teams/{team_id}/...`) | `403`, error code `agent_chat_not_enabled` |
| Token exchange for a team-locked key (`POST /platform-oauth/token`) | `400 invalid_grant`, with `reason: "agent_chat_not_enabled"` |
| `/mcp` with a team-locked key | `401` |

Turning a team off takes effect on the next call. A chat that is open stops working at its next request.

***

## Who can use agent chat on a team that is on

* **Platform admin chat:** the team owner, signed in as themselves (not with an API key). Ownership is checked again on every call.
* **Hub editor AI tab:** a person who can edit the hub. Their chat works only on that hub and its pages, using the hub and page tools listed in the [MCP tools reference](https://docs.member.dev/reference/mcp-tools.md).

> [!NOTE]
>
> Agent chat is in alpha. The routes on this page are first-party: the platform and hub editor call them for you, and they may change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.