Login with username and password
POST
https://app.speybooks.com/api/v1/auth/loginAuthenticate with username (or email) and password. If TOTP is enabled, returns a temporary token valid for 5 minutes that must be exchanged via the TOTP verify endpoint. If TOTP is not enabled, returns full access and refresh tokens immediately.
The response includes a user object with the authenticated user's profile for immediate UI hydration.
Failed attempts are tracked. After 5 failures, the account is locked for 15 minutes. Successful login resets the counter.
Body parameters
password string requiredAccount password.
username string requiredUsername or email address.
Response
200 Login successful. Returns access and refresh tokens, or a temporary token if TOTP verification is required.
Show response fields
accessToken stringexpiresIn integerrefreshToken stringuser objectShow child attributes
email stringfullName stringid integerisAdmin booleanusername stringError codes
400 Validation error in login data.
401 Invalid credentials. Includes attemptsRemaining count.
423 Account locked due to too many failed attempts. Includes time remaining.
429 Rate limit exceeded.