Authorization header. Tokens are obtained by logging in with your credentials and must be refreshed before they expire.
How authentication works
Log in with your credentials
Send a
POST request to /api/v1/auth/login with your email and password. The API returns an access_token and a refresh_token.Refresh the token before it expires
Access tokens expire after 1 hour. Use the
refresh_token to obtain a new access token without re-entering credentials.Login
POST /api/v1/auth/login
Exchange credentials for an access token and refresh token.
Request parameters
The user’s email address.
The user’s password. Must be at least 8 characters.
Response fields
JWT used to authenticate API requests. Include this in the
Authorization: Bearer header.Long-lived token used to obtain new access tokens. Store this securely.
Number of seconds until the access token expires. Typically
3600 (1 hour).Always
"Bearer".Example
Refresh token
POST /api/v1/auth/refresh
Obtain a new access token using a valid refresh token. The response includes a new access_token and resets the expiry. The refresh token itself is rotated on each use.
A valid refresh token obtained from the login response.
Logout
POST /api/v1/auth/logout
Revokes the current access token and its associated refresh token server-side. After logout, both tokens are immediately invalid.
Token expiry
| Token type | Lifetime |
|---|---|
| Access token | 1 hour |
| Refresh token | 7 days |
Security considerations
For security-sensitive applications, store tokens in memory or a secure HTTP-only cookie rather than
localStorage. Tokens stored in localStorage are accessible to any JavaScript on the page, making them vulnerable to XSS attacks.