更新 Turnstile
POST
/web/v1/workspaces/{workspaceId}/institutions/{institutionBizId}/turnstile/updateWEB更新指定机构的 Cloudflare Turnstile 配置。
鉴权
需要有效的 JWT token。网关验证:enableJwtToken=true,enableTurnstile=false。
请求参数
路径参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
workspaceId | string | Yes | path | 工作空间业务 ID |
institutionBizId | string | Yes | path | 机构业务 ID |
请求体
InstitutionTurnstileUpdateRequest:
| Name | Type | Required | In | Description |
|---|---|---|---|---|
turnstileSiteKey | string | Yes | body | Cloudflare Turnstile 站点密钥(最多 255 个字符) |
turnstileSecretKey | string | Yes | body | Cloudflare Turnstile 私密密钥(最多 255 个字符) |
remark | string | No | body | 配置备注(最多 255 个字符) |
成功响应
成功200
{
"code": "2000",
"message": "SUCCESS",
"data": {
"id": 1,
"institutionBizId": "inst_abc123",
"turnstileSiteKey": "0x4AAAAAAAB...",
"turnstileSecretKey": "****efgh",
"remark": "Production turnstile config",
"createdAt": "2026-03-21T00:00:00Z",
"updatedAt": "2026-03-21T01:00:00Z"
}
}错误响应
| 错误码 | 描述 |
|---|---|
4000 | 验证错误(缺少必填密钥) |
4010 | 未授权(无效或缺少 JWT token) |
4040 | 机构未找到 |
说明
turnstileSiteKey和turnstileSecretKey均为必填字段。- 私密密钥在响应中已脱敏。仅显示最后 4 位字符。
- 如果尚未存在 Turnstile 配置,此接口将创建一个。