Authentication
Login User
Authenticate a user and receive an access token
POST
Login User
Overview
Authenticates a user with email and password credentials, returning a JWT token for subsequent authenticated requests. This endpoint is rate-limited to 10 requests per 15-minute window.Authentication
No authentication required. This is a public endpoint.Request Body
The user’s email address
The user’s password. Must be at least 6 characters long.
Request Example
Response
JWT access token to be used for authenticated requests. Include this token in the Authorization header as
Bearer <token> for subsequent API calls.Response Example
Error Responses
401 Unauthorized
Returned when credentials are invalid. The error message is intentionally generic to avoid revealing whether the user exists.400 Bad Request
Returned when validation fails (invalid email format, password too short, missing fields).429 Too Many Requests
Returned when rate limit is exceeded (10 requests per 15 minutes).Using the Token
Once you receive the JWT token, include it in theAuthorization header for authenticated requests:
Notes
- The JWT token contains the user’s id, email, and role
- Passwords are never logged or exposed in responses
- Failed login attempts do not reveal whether the email exists in the system
- The token should be stored securely on the client side
Login User