Login
Authentication
Login
Authenticate and receive an access token
POST
Login
Authenticate with existing credentials and receive an access token.
Endpoint
Request Body
The user’s registered email address. Maximum 255 characters.Example:
"john.doe@example.com"The user’s password. Must be at least 8 characters.Example:
"SecurePass123"Response
JWT access token for authentication. Include this in the
Authorization header for subsequent requests.Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huLmRvZUBleGFtcGxlLmNvbSIsImV4cCI6MTcwOTU1MTIwMH0.abc123"The type of token. Always returns
"bearer".The authenticated user object.
Example Request
cURL
JavaScript
Python
Example Response
200 OK
Error Responses
401 Unauthorized - Invalid Credentials
422 Unprocessable Entity - Missing Fields
422 Unprocessable Entity - Invalid Email Format
500 Internal Server Error
Using the Access Token
After successful login, use the returned access token in theAuthorization header for authenticated requests:
Token Expiration
Access tokens expire after 3000 minutes (50 hours). When a token expires, you will receive a401 Unauthorized response and must login again to obtain a new token.
Security Considerations
- Never store passwords in plain text
- Use secure storage for access tokens (e.g., HTTP-only cookies, encrypted storage)
- Implement proper error handling to avoid leaking information
- Email addresses are case-insensitive (automatically converted to lowercase)
- Failed login attempts should not reveal whether the email exists
Notes
- Email addresses are automatically converted to lowercase and trimmed
- The same token format is used for both registration and login
- Both email and password must match exactly for authentication to succeed
- The response includes the full user object for convenience
