Documentation Index
Fetch the complete documentation index at: https://docs.mirobody.ai/llms.txt
Use this file to discover all available pages before exploring further.
国内主要走「邮箱 + 6 位验证码」两步登录,回传一个长期 JWT。也支持 OAuth 2.0。
1. 申请验证码
POST /email/login
Content-Type: application/json
{ "email": "user@example.com" }
响应:
{ "success": true, "code": 0, "msg": "ok", "data": { "email": "user@example.com" } }
同一邮箱 60 秒内再次申请会被限流(HTTP 429)。
2. 校验并换取 token
POST /email/verify
Content-Type: application/json
{ "email": "user@example.com", "code": "000000" }
响应(节选):
{
"success": true, "code": 0, "msg": "ok",
"data": {
"access_token": "eyJhbGci...",
"token_type": "Bearer",
"expires_in": 2592000,
"refresh_token": "eyJhbGci...",
"webauthn_registered": false
}
}
access_token 默认 30 天有效,到期前应提前续期,详见 Token 续期。
refresh_token 默认 60 天有效。
- JWT
sub 字段即数字 user_id。
3. 在请求中携带 token
Authorization: Bearer <access_token>
WebSocket(浏览器无法设置 Header):
4. 注销 / 改昵称
POST /user/del # 注销当前账号
POST /user/update_name # body: { "name": "新昵称" }
错误码
| HTTP | 业务 code | 含义 |
|---|
| 200 | -1 | 邮件服务未配置 |
| 200 | -2 | 验证码错误 / 邮箱校验失败 |
| 200 | -3 | 内部异常 |
| 429 | - | 限流 |
公开演示账号
Mirobody 在生产环境预置了 3 个公开评估账号,验证码恒为 777777,便于伙伴跑通完整流程:
| 邮箱 | 验证码 |
|---|
demo1@mirobody.ai | 777777 |
demo2@mirobody.ai | 777777 |
demo3@mirobody.ai | 777777 |
只需将上述邮箱 + 验证码套进上方 /email/login + /email/verify 即可拿到可用 token。
这些账号 公开共享,任何人都能登录;账号初始无任何数据,仅用于接口测试与调试。请勿 上传真实健康数据或敏感信息。Mirobody 不对 demo 账号中产生的数据安全负责。