Skip to main content

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.

China cluster uses an email + 6-digit verification code flow. OAuth 2.0 is also supported — see OAuth.

1. Request the code

POST /email/login
Content-Type: application/json
{ "email": "user@example.com" }
{ "success": true, "code": 0, "msg": "ok", "data": { "email": "user@example.com" } }
Repeating within 60s on the same email is rejected (HTTP 429).

2. Verify and exchange for token

POST /email/verify
Content-Type: application/json
{ "email": "user@example.com", "code": "000000" }
Response (excerpt):
{
  "success": true, "code": 0, "msg": "ok",
  "data": {
    "access_token":  "eyJhbGci...",
    "token_type":    "Bearer",
    "expires_in":    2592000,
    "refresh_token": "eyJhbGci...",
    "webauthn_registered": false
  }
}
  • access_token is a 30-day JWT. Refresh ahead of expiry — see Token Refresh.
  • refresh_token is valid for 60 days.
  • JWT sub claim equals the numeric user_id.

3. Carry the token

Authorization: Bearer <access_token>
WebSocket (browsers cannot set headers on WS):
?token=<access_token>

4. Account management

POST /user/del              # delete the current account
POST /user/update_name      # body: { "name": "New name" }

Error codes

HTTPcodeMeaning
200-1Email service not configured
200-2Wrong code / email validation failed
200-3Internal error
429-Rate-limited

Public demo accounts

Mirobody publishes 3 evaluation accounts on production with a fixed code 777777 so partners can exercise the full flow:
EmailCode
demo1@mirobody.ai777777
demo2@mirobody.ai777777
demo3@mirobody.ai777777
Drop any of these into the /email/login + /email/verify calls above to get a working token.
These accounts are publicly shared, anyone can sign in. They start empty and are intended strictly for API testing / debugging. Do not upload real health data or sensitive information. Mirobody is not responsible for the security of data in demo accounts.