Authentication
All API endpoints require authentication via Bearer Token (JWT).
Mechanism
The API uses the HTTP Bearer scheme (Authorization: Bearer <token>). Each request validates that the token is valid and the session is active. The token contains user information that the API uses to determine the scope of the returned data.
Required header
Authenticated request examples
Automatic company scope
There is no need to send any company identifier as a parameter. The API determines it from the token and applies it to all queries automatically.
Authentication errors
| Code | Description |
|---|---|
401 Unauthorized |
Invalid, expired token or inactive session. Header: WWW-Authenticate: Bearer |
403 Forbidden |
Valid token but missing id_company |
500 Internal Server Error |
Unexpected error while validating the token |
Swagger UI
To test the API from Swagger UI (/docs):
- Click the Authorize button (lock icon).
- In the
HTTPBearerfield, paste your token (without theBearerprefix). - Click Authorize and then Close.
All requests made from Swagger will include the token automatically.