---
title: "List Tenants"
method: GET
path: "/admin/tenants"
tags: ["admin"]
---

# List Tenants

`GET /admin/tenants`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/admin/tenants`
- Auth: none declared

每租户摘要（含用户/Agent/消息/文档计数）。sort=newest|oldest|users|messages|documents。

`q`：按**名字 / 别名 / UUID / 控制台登录邮箱** 模糊搜索——管理员手上拿到的可能是
任意一种，让他先想清楚"这串是什么"再选对应的框，是没必要的负担。邮箱走
tenant_accounts（客户员工登控制台用的账号）：自动开通的租户名虽带注册邮箱
（`agent4.io/<email>`），但客户改名后线索就断了，账号表才是稳定出处。

`hidden`：`false` 只列没被收起的（控制台面板的默认视图），`true` 只列收起来的，
**省略则两者都列**。默认不过滤是刻意的：一个默认就少返回一部分行的管理接口，会让
"我明明建了它，怎么查不到"变成一次排查——而这一层的调用方（脚本、测试、将来的别的
界面）要的是"库里到底有什么"。挑视图是界面的事，界面自己说清楚要哪一种。

按聚合列排序 → 用 offset 分页（cursor 为不透明 offset）；租户数量适中，性能可接受。

## Query parameters

- `sort` string
- `q` string, nullable
- `hidden` boolean, nullable
- `limit` integer
- `cursor` string, nullable

## Response `200`

Successful Response

- TenantPage
  - `items` TenantOut[], required
    - `id` string, required
    - `name` string, required
    - `alias` string, nullable
    - `note` string, nullable
    - `disabled` boolean, required
    - `privacy_mode` boolean, required
    - `onboarding_config` object, nullable
    - `auth_mode` string
    - `status` string
    - `profile` object, nullable
    - `byok_provider` string, nullable
    - `user_count` integer
    - `agent_count` integer
    - `message_count` integer
    - `document_count` integer
    - `tokens_24h` integer
    - `tokens_total` integer
    - `month_tokens` integer
    - `login_email` string, nullable
    - `logo` string, nullable
    - `hidden` boolean
    - `created_at` string, date-time, required
  - `next_cursor` string, nullable
  - `hidden_count` integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
