Login with username and password

POSThttps://app.speybooks.com/api/v1/auth/login

Authenticate 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

passwordstringrequired
Account password.
usernamestringrequired
Username or email address.

Response

200Login successful. Returns access and refresh tokens, or a temporary token if TOTP verification is required.
Show response fields
accessTokenstring
expiresIninteger
refreshTokenstring
userobject
Show child attributes
emailstring
fullNamestring
idinteger
isAdminboolean
usernamestring

Error 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.