Login with username and password
POST
https://app.speybooks.com/api/v1/auth/loginAuthenticate with a username (or email) and password. If TOTP is enabled the response carries requiresTotp and a short-lived temporary token to exchange at the TOTP verify endpoint; otherwise it carries the access and refresh tokens directly, with a user object for immediate UI hydration. A failed attempt is rate limited and, after repeated failures, temporarily locks the account; the error response carries a remaining-attempts indicator and, once locked, the time to wait before retrying. A successful login clears the counter.
Body parameters
passwordstringrequiredAccount password.
usernamestringrequiredUsername or email address.
Response
200Login successful. Returns access and refresh tokens, or a temporary token if TOTP verification is required.
Show response fields
accessTokenstringexpiresInintegerrefreshTokenstringuserobjectShow child attributes
emailstringfullNamestringidintegerisAdminbooleanusernamestringError codes
400Validation error in login data.
401Invalid credentials. Includes attemptsRemaining count.
423Account locked due to too many failed attempts. Includes time remaining.
429Rate limit exceeded.