Authentication
LabTrace uses JWT (JSON Web Tokens) for authentication. All API endpoints except authentication-related ones require a valid JWT token in the Authorization header.Authentication Flow
- Register a new user account
- Login with email and password to receive a JWT token
- Include the JWT token in the Authorization header for all subsequent requests
- Use password reset functionality if needed
Headers
For authenticated requests, include the JWT token in the Authorization header:Login
POST /login
Authenticate a user and receive a JWT token
Request Body
Response
Example
User Registration
POST /users
Register a new user account
Request Body
Response
Example
Account Activation
GET /users/activation/{token}
Activate a user account using the token sent via email
Parameters
token(path): Activation token received via email
Response
Password Reset
Request Password Reset
GET /users/forgot-password/{email}
Request a password reset email
Parameters
email(path): User’s email address
Response
Reset Password
POST /users/reset-password/{token}
Reset password using the token sent via email
Parameters
token(path): Password reset token received via email
Request Body
Response
Example
Error Responses
All authentication endpoints may return the following error responses:400 Bad Request
401 Unauthorized
500 Internal Server Error
JWT Token Information
JWT tokens contain the following claims:id: User IDemail: User emailiat: Issued at timestampexp: Expiration timestamp
