Register User
Request Body
Valid email address (lowercase, trimmed)
Password meeting security requirements:
- Minimum 8 characters
- Maximum 64 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character
User’s first name (1-50 characters, trimmed)
User’s last name (1-50 characters, trimmed)
Response
Success message: “Registration successful!”
User object containing profile information
JWT access token for API authentication (short-lived)
JWT refresh token for obtaining new access tokens (long-lived)
Error Responses
- 400 Bad Request - Validation errors (invalid email, weak password, missing fields)
- 409 Conflict - Email already registered
- 500 Internal Server Error - Server error
Login
Request Body
Valid email address (lowercase, trimmed)
User’s password
Response
Success message: “Login successful!”
User object containing profile information
JWT access token for API authentication
JWT refresh token for obtaining new access tokens
Error Responses
- 400 Bad Request - Validation errors (invalid email, missing password)
- 401 Unauthorized - Invalid credentials
- 500 Internal Server Error - Server error
Refresh Token
Request Body
Valid refresh token received from login or registration
Response
Success message: “Token refreshed successfully!”
New JWT access token
New refresh token (rotation strategy)
Error Responses
- 400 Bad Request - Missing or empty refresh token
- 401 Unauthorized - Invalid or expired refresh token
- 500 Internal Server Error - Server error
Logout
Headers
Bearer token:
Bearer {accessToken}Request Body
Refresh token to invalidate (minimum 1 character)
Response
Success message: “Logout successful.”
Error Responses
- 400 Bad Request - Missing refresh token
- 401 Unauthorized - Missing or invalid access token
- 500 Internal Server Error - Server error