登录与 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/json

object · 规范允许任意字段

GET列出可用员工身份/boma/v1/auth/identities
鉴权登录会话 · Bearer

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

POST选择员工身份/boma/v1/auth/select-identity
鉴权登录会话 · Bearer

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_tokenstring

The current session's refresh token, to issue a refreshable identity session.

realmplatform | agency | merchant必填

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

GET获取当前用户/boma/v1/auth/user
鉴权登录会话 · Bearer

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

GET获取当前员工身份/boma/v1/auth/me
鉴权已选身份的会话 / Boma API Key

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

POST刷新会话/boma/v1/auth/refresh
鉴权续期凭证 · Bearer

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/json
tokenstring必填

Access token for the session.

expires_atstring必填
date-time
refresh_tokenstring

Single-use token for the refresh endpoint. Issued on new logins and inherited as a separate token by selected identity sessions.

refresh_expires_atstring

Fixed refresh deadline shared by the login session and its selected identities.

date-time
401Refresh token invalid, expired, or revoked

此状态在规范中没有响应体定义。

POST退出全部会话/boma/v1/auth/logout
鉴权登录会话 · Bearer

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

PUT修改密码/boma/v1/auth/password
鉴权登录会话 · Bearer

请求体

application/json必填
current_passwordstring必填
passwordstring必填

8..72 bytes.

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

GET查询认证器状态/boma/v1/auth/mfa
鉴权登录会话 · Bearer

Read current MFA status using a fully authenticated user session.

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

POST生成绑定二维码/boma/v1/auth/mfa/enroll
鉴权MFA 临时凭证 · Bearer

Generate a new pending secret using an enrollment challenge. Supersedes the previous QR code for this challenge.

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

POST确认认证器绑定/boma/v1/auth/mfa/confirm
鉴权MFA 临时凭证 · Bearer

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/json

object · 规范允许任意字段

POST验证 TOTP/boma/v1/auth/mfa/verify
鉴权MFA 临时凭证 · Bearer

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/json

object · 规范允许任意字段

POST使用恢复码/boma/v1/auth/mfa/recover
鉴权MFA 临时凭证 · Bearer

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/json

object · 规范允许任意字段

POST开始更换认证器/boma/v1/auth/mfa/replace
鉴权登录会话 · Bearer

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/json

object · 规范允许任意字段

POST撤销 MFA 临时凭证/boma/v1/auth/mfa/cancel
鉴权MFA 临时凭证 · Bearer

Invalidate a challenge. Accepts only a challenge token.

响应

200Success
application/json

任意值

defaultError
application/json

object · 规范允许任意字段

GET列出用户 API Key/boma/v1/auth/api-keys
鉴权登录会话 · Bearer

List this user's keys across employee identities. Requires a full login session.

响应

200Success
application/json
idstring必填
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
鉴权已选身份的会话 · Bearer

Create a key bound to the employee identity selected in the supplied session.

请求体

application/json必填
namestring必填
最短 1 字符 · 最长 256 字符

响应

200Success
application/json
idstring必填
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}
鉴权登录会话 · Bearer

Revoke one key belonging to the session user.

参数

参数位置类型说明
key路径string必填

响应

200Success
application/json
okboolean必填
404No such key for this user.

此状态在规范中没有响应体定义。