登录与 API Key
登录、身份、MFA、会话续期和 API Key。
使用流程与权限要求见 鉴权与请求签名。
POST用户名密码登录/boma/v1/auth/login
Returns status=authenticated with session tokens, user and identities, or status=mfa_enrollment_required/mfa_verification_required with challenge_token and expires_at (5 minutes). Challenge tokens cannot select identities, change passwords, or access business APIs.
请求体
application/json必填usernamestring必填passwordstring必填
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
GET列出可用员工身份/boma/v1/auth/identities
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST选择员工身份/boma/v1/auth/select-identity
Issues a separate session for the selected identity with the same access expiration as the source session. Supply the source session's refresh_token to issue a separate refresh token with the same deadline.
请求体
application/json必填employee_idstring必填refresh_tokenstringThe current session's refresh token, to issue a refreshable identity session.
realmplatform | agency | merchant必填
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
GET获取当前用户/boma/v1/auth/user
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
GET获取当前员工身份/boma/v1/auth/me
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST刷新会话/boma/v1/auth/refresh
Send the refresh_token as Authorization: Bearer <refresh_token>. Rotates both tokens for the same session and identity. The refresh deadline stays 72 hours after the original login.
响应
200Rotated session tokens
application/jsontokenstring必填Access token for the session.
expires_atstring必填- date-time
refresh_tokenstringSingle-use token for the refresh endpoint. Issued on new logins and inherited as a separate token by selected identity sessions.
refresh_expires_atstringFixed refresh deadline shared by the login session and its selected identities.
date-time
401Refresh token invalid, expired, or revoked
此状态在规范中没有响应体定义。
POST退出全部会话/boma/v1/auth/logout
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
PUT修改密码/boma/v1/auth/password
请求体
application/json必填current_passwordstring必填passwordstring必填8..72 bytes.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
GET查询认证器状态/boma/v1/auth/mfa
Read current MFA status using a fully authenticated user session.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST生成绑定二维码/boma/v1/auth/mfa/enroll
Generate a new pending secret using an enrollment challenge. Supersedes the previous QR code for this challenge.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST确认认证器绑定/boma/v1/auth/mfa/confirm
Confirm enrollment, return one-time recovery codes and a full login session. Revokes all older sessions and challenges.
请求体
application/json必填codestring必填Six-digit TOTP code, or a recovery code on the recovery endpoint.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST验证 TOTP/boma/v1/auth/mfa/verify
Exchange a password-authenticated verification challenge and a TOTP code for a full login session.
请求体
application/json必填codestring必填Six-digit TOTP code, or a recovery code on the recovery endpoint.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST使用恢复码/boma/v1/auth/mfa/recover
Consume a recovery code with a verification challenge. Returns an enrollment-only challenge, never a business session.
请求体
application/json必填codestring必填Six-digit TOTP code, or a recovery code on the recovery endpoint.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST开始更换认证器/boma/v1/auth/mfa/replace
Verify password and existing TOTP to start replacement. The existing factor stays active until the replacement is confirmed. Also supports optional merchant enrollment.
请求体
application/json必填current_passwordstring必填codestring必填Current authenticator code. Empty only when enrolling an account without an authenticator.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
POST撤销 MFA 临时凭证/boma/v1/auth/mfa/cancel
Invalidate a challenge. Accepts only a challenge token.
响应
200Success
application/json任意值
defaultError
application/jsonobject · 规范允许任意字段
GET列出用户 API Key/boma/v1/auth/api-keys
List this user's keys across employee identities. Requires a full login session.
响应
200Success
application/jsonidstring必填- uuid
namestring必填realmstring必填employee_idstring必填- uuid
employee_namestring必填created_atstring必填- date-time
last_used_atstring必填- date-time · 可为 null
POST创建用户 API Key/boma/v1/auth/api-keys
Create a key bound to the employee identity selected in the supplied session.
请求体
application/json必填namestring必填- 最短 1 字符 · 最长 256 字符
响应
200Success
application/jsonidstring必填- uuid
secretstring必填32 random bytes encoded as unpadded base64url. Returned once.
401An active selected-identity session is required.
此状态在规范中没有响应体定义。
DELETE撤销用户 API Key/boma/v1/auth/api-keys/{key}
Revoke one key belonging to the session user.
参数
| 参数 | 位置 | 类型 | 说明 |
|---|---|---|---|
key | 路径 | string | 必填 |
响应
200Success
application/jsonokboolean必填
404No such key for this user.
此状态在规范中没有响应体定义。