The signed-in user's profile, password, two-factor authentication and notification preferences.
Get the signed-in user
Profile, admin flag, credit balance and sign-in methods of the session's user.
Get the signed-in user › Responses
The user.
idemailnameis_adminbalance_nanoCredit balance in nano-USD (1 USD = 1,000,000,000). Includes credit currently reserved by in-flight requests as already spent.
mfa_enabledTwo-factor authentication is set up.
has_passwordCan sign in with a password (Google-only accounts can't).
google_linkedcreated_atChange the password
Requires the current password. The new one must be at least 8 characters (10 for admins) and
different. All other sessions end; the response carries a new session token for this client
(keeping its 2FA state) — replace the stored token. Google-only accounts (no password) get 400
and should use forgot-password to add one. Limited to 5 attempts per minute.
Change the password › Request Body
current_passwordnew_passwordChange the password › Responses
New session token.
tokenSession token (JWT, valid 7 days). Send as Authorization: Bearer <token>.
Get notification preferences
Low-balance email alert settings.
Get notification preferences › Responses
Preferences.
low_balance_alertlow_balance_threshold_nanoCustom threshold in nano-USD; null uses the default.
default_threshold_nanoThe default threshold (1 USD = 1000000000).
Update notification preferences
Turns the low-balance email alert on or off and sets its threshold (nano-USD, 0 to
10,000 USD; null uses the default of 1 USD). Saving starts a fresh alert cycle.
Update notification preferences › Request Body
low_balance_alertlow_balance_threshold_nanoThreshold in nano-USD; null = default.
Update notification preferences › Responses
Saved preferences.
low_balance_alertlow_balance_threshold_nanoCustom threshold in nano-USD; null uses the default.
default_threshold_nanoThe default threshold (1 USD = 1000000000).
Start turning on two-factor authentication
Returns a new TOTP secret (the same one again while it is pending, for 15 minutes). Confirm with
POST /api/me/mfa/enable. 400 if 2FA is already on.
Start turning on two-factor authentication › Responses
Enrolment details.
secretBase32 secret in groups of 4 characters, for manual entry.
otpauth_uriotpauth://totp/… URI.
qr_svgSVG markup of the QR code for otpauth_uri.
accountThe user's email.
issuerThe site name.
Confirm and turn on two-factor authentication
Confirms the pending secret with a current 6-digit code. 2FA turns on, all other sessions end, and the response carries the recovery codes (shown once) and a new session token to replace the stored one. Limited to 10 attempts per minute.
Confirm and turn on two-factor authentication › Request Body
code6-digit authenticator code (or a recovery code where accepted).
Confirm and turn on two-factor authentication › Responses
2FA is on.
recovery_codestokenNew session token (JWT).
Turn off two-factor authentication
Needs a current code or a recovery code. Not allowed for admins (403, 2FA is required for them).
All other sessions end; the response carries a new session token. Limited to 10 attempts per minute.
Turn off two-factor authentication › Request Body
code6-digit authenticator code (or a recovery code where accepted).
Turn off two-factor authentication › Responses
2FA is off.
tokenSession token (JWT, valid 7 days). Send as Authorization: Bearer <token>.
Regenerate 2FA recovery codes
Issues new recovery codes (the old ones stop working). Needs a current 6-digit authenticator code. Limited to 10 attempts per minute.
Regenerate 2FA recovery codes › Request Body
code6-digit authenticator code (or a recovery code where accepted).
Regenerate 2FA recovery codes › Responses
The new codes, shown once.
recovery_codes