How authentication works
Create an account or log in
Call
POST /register to create a new account, or POST /login if you already have one.Include the token in requests
Pass the token in the
Authorization header as Bearer <token> on all protected endpoints.Register
Developer role by default. No token is returned — log in after registering to get a token.
Request body
The user’s full name. Cannot be empty.
A valid email address. Must be unique — registering with an existing email returns a
400 error.The account password. Must meet all of the following rules:
- Minimum 8 characters
- At least one uppercase letter
- At least one number
Example
Response
201
Registration does not return a token. After registering, call
POST /auth/login with the same credentials to get your accessToken.Login
Request body
The registered email address.
The account password.
Example
Response
true on successful login.Confirmation message.
200
Using the token
Include theaccessToken from the login response in the Authorization header of every protected request:
Token expiration
Tokens are valid for 30 minutes from the time of issue. Once expired, protected endpoints return a401 response:
Expired token
POST /login again to get a fresh token.
Error responses
| Status | Cause | Response message |
|---|---|---|
400 | Email already registered | Email duplicado |
400 | Validation failure (e.g., weak password) | Field-level validation errors |
401 | Wrong email or password | Credenciales invalidas |
401 | Account deactivated | Usuario desactivado, comunicate con el administrador |
401 | Token expired | El token ha expirado |
403 | Valid token but insufficient role | No tienes permiso para esta acción |