接口详情
POST /v1/auth/bridge-sso
Exchange a billing bridge one-time ticket for a console session
- operationId
exchangeBillingBridgeSso- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Called by the console page /sso/bridge?ticket=… without Authorization (the ticket is the credential). Signs the customer in with an ordinary session of its own (not impersonation; audit auth.login with authentication_method billing_bridge and auth.session.bridge_sso). Expired, reused, unknown, disabled-user and terminated-service tickets are all 401 bridge_sso_invalid. The account's e-mail/SMS login verification is skipped; when the plugin setting sso_require_mfa is on and the customer has TOTP, the first call is 401 mfa_required and the same ticket is sent again with authentication (mfa_invalid_code, mfa_code_replayed on a wrong code; five wrong codes void the ticket).
请求体
application/json · 必填:是
exchangeBillingBridgeSso 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
ticket | string | 是 | — |
|---|
authentication | object | 否 | — |
|---|
响应
exchangeBillingBridgeSso 响应| 状态码 | 说明 |
|---|
200 | Signed in. The refresh token is set only as an HttpOnly cookie. 字段:access_token: string token_type: string expires_in: integer(int64) principal: Principal impersonation?: ImpersonationMarker redirect: string |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | bridge_sso_invalid, mfa_required, mfa_invalid_code or mfa_code_replayed. |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
503 | A required dependency is unavailable. |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/login
Authenticate and create a refresh-token family
- operationId
login- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
参数
login 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 否 | Required when login_challenge is present. Reuse only for the same challenge and code. |
|---|
请求体
application/json · 必填:是
login 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
username | string | 是 | — |
|---|
password | string(password) | 是 | — |
|---|
scope_id | string(uuid) | 否 | Optional active platform or tenant scope. Platform is preferred when omitted. |
|---|
login_challenge | object | 否 | Additional email/SMS proof. Password, current policy, source, contact and code are rechecked when creating the session in the same transaction. |
|---|
captcha | LoginCaptchaAnswer | 否 | Solved built-in sign-in CAPTCHA (POST /v1/auth/login-captchas). Case-insensitive. |
|---|
响应
login 响应| 状态码 | 说明 |
|---|
200 | Authenticated. The rotating refresh token is returned only as an HttpOnly cookie. 字段:access_token: string token_type: string expires_in: integer(int64) principal: Principal impersonation?: ImpersonationMarker |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | Invalid credentials, login_verification_required after a correct password, login_captcha_required once the platform CAPTCHA threshold (login_captcha_threshold_per_hour) is reached for this account and source, or login_captcha_invalid. No session is created until the required code succeeds. |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
409 | 请求的状态与已有资源或幂等记录冲突。 |
|---|
429 | login_throttled. The account has login_failure_limit_per_hour credential failures from this source in the last hour (or the source has five times that across accounts). Another source is not affected. Retry after the Retry-After seconds. |
|---|
503 | A required dependency is unavailable. |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/login-captchas
Issue a one-time built-in sign-in CAPTCHA bound to the source address
- operationId
issueLoginCaptcha- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requested after login_captcha_required. The answer is never returned as text; send {id, answer} as captcha with the next password attempt. Each challenge is consumed by one attempt and expires after five minutes. Thirty challenges per source per hour.
响应
issueLoginCaptcha 响应| 状态码 | 说明 |
|---|
201 | CAPTCHA issued. 字段:id: string(uuid) image: string expires_at: string(date-time) |
|---|
429 | login_captcha_rate_limited. |
|---|
503 | A required dependency is unavailable. |
|---|
失败时怎么办
429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/login-challenge-verifications
Consume one verification code and create a login session
- operationId
verifyAccountLoginChallenge- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
The code and session are committed in the same transaction after the current source policy and bound contact are checked. Accounts requiring password plus a code must finish through /v1/auth/login instead; this endpoint cannot bypass that requirement and returns account_login_verification_invalid.
参数
verifyAccountLoginChallenge 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
X-Request-ID | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
verifyAccountLoginChallenge 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
challenge_id | string(uuid) | 是 | — |
|---|
identifier | string | 是 | — |
|---|
channel | string: email / sms | 是 | — |
|---|
otp | string | 是 | — |
|---|
响应
verifyAccountLoginChallenge 响应| 状态码 | 说明 |
|---|
200 | Authenticated. The rotating refresh token is returned only as an HttpOnly cookie and the one-time challenge is consumed. 字段:access_token: string token_type: string expires_in: integer(int64) principal: Principal |
|---|
401 | Stable error without provider details or sensitive input. |
|---|
403 | Stable error without provider details or sensitive input. |
|---|
409 | Stable error without provider details or sensitive input. |
|---|
422 | Stable error without provider details or sensitive input. |
|---|
503 | Stable error without provider details or sensitive input. |
|---|
失败时怎么办
401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/login-challenges
Queue a login code or the additional code required after password verification
- operationId
createAccountLoginChallenge- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
参数
createAccountLoginChallenge 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
X-Request-ID | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
响应
createAccountLoginChallenge 响应| 状态码 | 说明 |
|---|
202 | Challenge accepted without identifying whether the account exists. 字段:data: object |
|---|
401 | Stable error without provider details or sensitive input. |
|---|
403 | Stable error without provider details or sensitive input. |
|---|
409 | Stable error without provider details or sensitive input. |
|---|
422 | Stable error without provider details or sensitive input. |
|---|
429 | Bounded retry response without identifying the limiting dimension. |
|---|
503 | Stable error without provider details or sensitive input. |
|---|
失败时怎么办
401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
GET /v1/auth/login-methods
Read enabled email and SMS login methods
- operationId
getAccountLoginMethods- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
响应
getAccountLoginMethods 响应| 状态码 | 说明 |
|---|
200 | Public login method policy for the resolved platform scope. 字段:data: object |
|---|
422 | Stable error without provider details or sensitive input. |
|---|
503 | Stable error without provider details or sensitive input. |
|---|
失败时怎么办
503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/logout
Revoke the refresh-token family
- operationId
logout- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
When the request still carries the cdnca_impersonation cookie, the impersonation it identifies is revoked first (reason logout), so the cookie is refused immediately instead of at its expiry.
响应
logout 响应| 状态码 | 说明 |
|---|
204 | The family is revoked or the cookie was already absent. |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
GET /v1/auth/me
Return the current user, scope, roles, and permissions
- operationId
getCurrentIdentity- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requires the server-side identity.self.read permission in the active scope.
参数
getCurrentIdentity 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
limit | query | integer | 否 | — |
|---|
status | query | string: pending_activation / active / revoked | 否 | — |
|---|
name | query | string | 否 | — |
|---|
key_id | query | string | 否 | — |
|---|
cursor | query | string | 否 | — |
|---|
响应
getCurrentIdentity 响应| 状态码 | 说明 |
|---|
200 | Current identity and effective RBAC grants. An active impersonation cookie returns the target principal with a non-sensitive impersonation marker. 字段:user_id: string(uuid) display_id: string scope_id: string(uuid) scope_kind: string: platform / tenant tenant_id?: string(uuid) | null(uuid) username: string display_name: string roles: array<string> permissions: array<string> password_change_required?: boolean impersonation?: ImpersonationMarker |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/refresh
Rotate the refresh token and issue a new access token
- operationId
refresh- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
响应
refresh 响应| 状态码 | 说明 |
|---|
200 | Rotated. An active impersonation cookie returns the target principal and a non-sensitive impersonation marker. Reusing the previous refresh cookie revokes the complete token family. 字段:access_token: string token_type: string expires_in: integer(int64) principal: Principal impersonation?: ImpersonationMarker |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/register
Register a tenant owner account
- operationId
registerAccount- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requires exact application/json, one Idempotency-Key, and one trusted X-Request-ID. JSON is size bounded and rejects duplicate keys, unknown fields, media-type parameters, trailing values, and query parameters. The configured current terms version must be accepted. A 202 response never reports whether username, email, or phone already existed.
参数
registerAccount 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | Stable key for the normalized registration and server-verified proof. Reusing it with a different payload or proof evidence returns 409. |
|---|
X-Request-ID | header | string | 是 | Trusted request identifier for receipt and audit correlation. |
|---|
请求体
application/json · 必填:是
registerAccount 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
username | string | 是 | — |
|---|
password | string(password) | 是 | 8 to 1024 printable ASCII characters (no space) with at least two of upper case, lower case, digits and symbols; otherwise password_policy_unmet. |
|---|
display_name | string | 是 | — |
|---|
email | string(email) | 是 | — |
|---|
phone | string | 是 | — |
|---|
terms_accepted | boolean | 是 | — |
|---|
terms_version | string | 是 | — |
|---|
verification_channel | string: email / sms | 是 | — |
|---|
响应
registerAccount 响应| 状态码 | 说明 |
|---|
202 | Uniform registration acceptance or exact idempotent replay. 字段:accepted: boolean replayed: boolean |
|---|
409 | Stable error without raw service messages or sensitive input. |
|---|
422 | Stable error without raw service messages or sensitive input. |
|---|
429 | Rate limit response without identifying the limiting dimension. |
|---|
503 | Stable error without raw service messages or sensitive input. |
|---|
失败时怎么办
409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/registration-challenge-verifications
Consume one contact verification code and issue a registration proof cookie
- operationId
verifyAccountRegistrationChallenge- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
参数
verifyAccountRegistrationChallenge 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
X-Request-ID | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
verifyAccountRegistrationChallenge 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
challenge_id | string(uuid) | 是 | — |
|---|
username | string | 是 | — |
|---|
email | string(email) | 是 | — |
|---|
phone | string | 是 | — |
|---|
verification_channel | string: email / sms | 是 | — |
|---|
otp | string | 是 | — |
|---|
响应
verifyAccountRegistrationChallenge 响应| 状态码 | 说明 |
|---|
204 | Contact verified. The proof reference is available only in a secure host cookie. |
|---|
409 | Stable error without provider details or sensitive input. |
|---|
422 | Stable error without provider details or sensitive input. |
|---|
429 | Bounded retry response without identifying the limiting dimension. |
|---|
503 | Stable error without provider details or sensitive input. |
|---|
失败时怎么办
409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/registration-challenges
Verify a human and queue one contact verification code
- operationId
createAccountRegistrationChallenge- 认证
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
参数
createAccountRegistrationChallenge 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
X-Request-ID | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
createAccountRegistrationChallenge 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
username | string | 是 | — |
|---|
email | string(email) | 是 | — |
|---|
phone | string | 是 | — |
|---|
verification_channel | string: email / sms | 是 | — |
|---|
human_token | string | 是 | — |
|---|
响应
createAccountRegistrationChallenge 响应| 状态码 | 说明 |
|---|
202 | Challenge accepted without identifying existing accounts. 字段:data: object |
|---|
409 | Stable error without provider details or sensitive input. |
|---|
422 | Stable error without provider details or sensitive input. |
|---|
429 | Bounded retry response without identifying the limiting dimension. |
|---|
503 | Stable error without provider details or sensitive input. |
|---|
失败时怎么办
409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。429 被限速:等待后再试,降低并发。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/auth/session-region-verifications
Re-bind the session to its current region with the password
- operationId
verifySessionRegion- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Called after a session request returned 401 session_region_changed (platform setting session_region_check). The password attempt is throttled like sign-in.
请求体
application/json · 必填:是
verifySessionRegion 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
password | string | 是 | — |
|---|
响应
verifySessionRegion 响应| 状态码 | 说明 |
|---|
204 | Session re-bound to the current region. |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | invalid_session or invalid_credentials. |
|---|
429 | login_throttled. |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。429 被限速:等待后再试,降低并发。
↑ 回到列表