创建租户管理员初始化
POST
/web/v1/workspaces/{workspaceId}/institutions/{institutionBizId}/admin-initWEB为指定机构启动租户管理员邀请流程。向指定的管理员发送邀请邮件。
鉴权
需要有效的 JWT token。网关验证:enableJwtToken=true,enableTurnstile=false。
请求参数
路径参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
workspaceId | string | Yes | path | 工作空间业务 ID |
institutionBizId | string | Yes | path | 机构业务 ID |
请求体
TenantAdminInitRequest:
| Name | Type | Required | In | Description |
|---|---|---|---|---|
email | string | Yes | body | 管理员邮箱地址(最多 255 个字符,须为有效邮箱格式) |
name | string | No | body | 管理员显示名称(2-126 个字符) |
phone | string | No | body | 管理员电话号码(E.164 格式,最多 25 个字符) |
成功响应
成功200
{
"code": "2000",
"message": "SUCCESS",
"data": {
"institutionBizId": "inst_abc123",
"email": "admin@example.com",
"sessionId": "sess_xyz789",
"expiresAt": "2026-03-22T00:00:00Z",
"created": true,
"emailSent": true
}
}错误响应
| 错误码 | 描述 |
|---|---|
4000 | 验证错误(无效的邮箱格式、名称过短/过长) |
4010 | 未授权(无效或缺少 JWT token) |
4040 | 机构未找到 |
说明
- 如果同一邮箱已存在待处理的初始化记录,
created将为false,并重新发送邀请邮件。 sessionId可用于跟踪初始化流程。expiresAt字段表示会话的过期时间。