Skip to Content
MuoCeon Docs
v1auth context

Sign-in and registration

POST /v1/auth/login and POST /v1/auth/register — start parameters, flow token and available verification methods.

Sign-in and registration share one shape: submit an identifier and a device id, receive a flow token (JWE), then complete the verification challenges one by one. The only difference is where the methods come from — sign-in compares against existing credentials, registration stages the new ones inside the flow token.

Endpoints

MethodPathPurpose
POST/v1/auth/loginStart sign-in
POST/v1/auth/registerStart registration

Both require a Cloudflare Turnstile token. It is the only thing standing between this endpoint and bulk scripting, so a missing or failed token is rejected outright.

Request body

ParameterTypeRequiredNotes
idstring✅Username or email, 3–255 chars; trimmed and lowercased server-side
didstring✅Device id, 8–256 chars; first-party sessions are accounted per device
turnstilestring✅Turnstile token
{
  "id": "[email protected]",
  "did": "device-8f3a1c2b",
  "turnstile": "0.xxxxx"
}

Response

{
  "success": true,
  "flow_token": "eyJhbGciOi...",
  "available_methods": [
    { "type": "email", "masked": "a***@example.com", "remaining": 1 },
    { "type": "passkey", "remaining": 1 }
  ]
}
FieldNotes
flow_tokenThe flow token (JWE). Every subsequent verification request sends it as Authorization: Bearer, and the server rotates it each time
available_methods[].typeemail / password / passkey / authenticator / recovery_code
available_methods[].maskedMasked contact value; present for email only
available_methods[].remainingRemaining attempts for that method

available_methods may be empty on registration

A brand-new account has no verified credential yet, so this array can be empty in the registration response. An empty array means "no method available yet", not "registration failed".

What happens next

  1. Use flow_token with the matching endpoint in Verification challenges;
  2. every successful step returns a new flow_token; continue with the new one, the old one stops working;
  3. once all required steps are done, call POST /token in Tokens with the last flow_token to obtain an access token and a refresh token.

Silent failure

During sign-in, if the requested email does not match the methods recorded in the flow token, the server returns success without sending anything. This is deliberate: an error would tell the caller "this account has no such email", leaking the account's structure.

On this page