<a id="admin-operations"></a>

# `admin` 操作

<!-- i18n: source=docs/reference/operations/admin.md blob=f39b9129b91eb2d7bee29920a25a97a24df4b80b model=claude-sonnet-5-5 -->
> 本页由机器从[英文原文](https://github.com/ClickHouse/loom/blob/main/docs/reference/operations/admin.md)翻译，内容以英文原文为准。
> Machine-translated from the [English page](https://github.com/ClickHouse/loom/blob/main/docs/reference/operations/admin.md), which is authoritative.


每个 `admin.*` 操作所接受和返回的确切字段。

<!-- Generated by `python scripts/codegen/docs_reference.py` from the op registry; edit the models, not this page. -->

每个操作都是通过 HTTP 的 `POST /v1/<op>`，同时也是 MCP 工具 `loom_<op>`。身份字段（`org`、`namespace`、`agent`、`user_id`、`session_id`）会在传输层能够提供时，从令牌和 MCP 会话中填充；对于单用户服务器上不带令牌的 HTTP 调用，除 `code.*` 和 `tracker.*`（它们保留各自平面的 org）之外的所有操作都使用该安装的 org，而对于[部分操作](https://github.com/ClickHouse/loom/blob/main/docs/reference/http-api.md#request)，其命名空间和 agent 也会被填充；参见[身份与命名空间](/zh-CN/concepts/identities-and-namespaces)。[操作索引](https://github.com/ClickHouse/loom/blob/main/docs/reference/operations.md)说明了角色、类型以及 MCP 的 `all` 列表。未知的输入字段仍会被处理，并在 `ignored_args` 中列出。

<!-- prettier-ignore-start -->

<a id="adminusers"></a>

## `admin.users`

汇总来自 namespace_grants 和 namespaces.owner_email 的用户主体，结合审计日志中的最近活跃时间，并标记已配置的平台管理员。

`POST /v1/admin.users` · MCP `loom_admin_users` · 角色 `org_admin` · 幂等 · 不在 MCP `all` 工具集中列出

| 输入字段 | 类型 | 默认值 | 含义 |
| --- | --- | --- | --- |
| `org` | `str` | 必填 | 租户（身份元组的第一个元素）。 |
| `namespace` | `str \| None` | `None` | 该操作读取或写入的命名空间。 |
| `include_service_accounts` | `bool` | `False` | 同时列出既没有联系邮箱也没有密码的主体（服务账号）；关闭时，这些主体不会列出。 |
| `limit` | `int` | `200` | 最多返回这么多用户，按主体顺序排列；取值范围为 1 到 1,000。 |

| 输出字段 | 类型 | 含义 |
| --- | --- | --- |
| `users` | `list[UserSummary]` | 按主体顺序排列的一页用户，每个用户附带其授权和所拥有的命名空间。 |
| `total` | `int` | 应用 `limit` 之前，符合过滤条件的用户数。 |
| `total_pending_elevations` | `int` | 本页中带有未批准提权请求的授权数。 |
| `total_active_last_7d` | `int` | 本页中在过去 7 天内有审计记录的用户数。 |
| `platform_admins_configured` | `list[str]` | 已配置的平台管理员身份，已排序；除非调用者是平台管理员（或未启用认证），否则为空。 |

<!-- prettier-ignore-end -->
