Skip to content

轮转访问码

POST/web/v1/workspaces/{workspaceId}/institutions/{institutionBizId}/portals/portal-types/{portalType}/access-code/rotateWEB

轮转指定 Portal 类型的访问码。生成新码的同时,旧码在过渡期内仍然有效。

鉴权

需要有效的 JWT token。网关验证:enableJwtToken=trueenableTurnstile=false

请求参数

路径参数

NameTypeRequiredInDescription
workspaceIdstringYespath工作空间业务 ID
institutionBizIdstringYespath机构业务 ID
portalTypeintegerYespathPortal 类型代码(例如:10010101=system、10010102=tenant)

成功响应

成功200
{
  "code": "2000",
  "message": "SUCCESS",
  "data": {
    "accessCode": "pac_xxxx5678efgh",
    "institutionBizId": "inst_abc123",
    "portalType": 10010102,
    "expiresAt": "2026-06-21T00:00:00Z",
    "rotatingCode": "pac_xxxx1234abcd",
    "rotatingCodeExpiresAt": "2026-03-28T00:00:00Z"
  }
}

错误响应

错误码描述
4010未授权(无效或缺少 JWT token)
4040Portal 或访问码未找到

说明

  • 在轮转期间,新的主访问码和旧的轮转码均有效。
  • rotatingCode 将在 rotatingCodeExpiresAt 时过期,届时仅新的主访问码有效。
  • 这使得客户端可以实现零停机的访问码轮转。

内部文档