The Botica Nova Salud API uses JSON Web Tokens (JWT) for authentication. You first exchange a username and password for a signed token, then include that token in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/15aozzz/Lab-Nova-Salud/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header of every subsequent request. Tokens are signed with HS256 using the JWT_SECRET value set in backend/.env and expire after 8 hours.
Only
POST /api/auth/login is public. Every other endpoint requires a valid Bearer token.Authentication flow
Login to obtain a token
Send a Request body fieldsExample requestSuccessful response — Response fields
POST request to /api/auth/login with your credentials in the request body.EndpointThe username of the system user (e.g.
admin, cajero1).The user’s plaintext password. The server hashes it with SHA-256 before comparing against the stored hash.
200 OKSigned JWT Bearer token. Valid for 8 hours from the time of issue.
Basic profile of the authenticated user.
Token expiration
Tokens expire 8 hours after they are issued. After expiration, requests will receive a401 Token inválido response. Log in again to obtain a fresh token.
Error responses
| Status | Body | When |
|---|---|---|
401 | { "error": "Usuario no encontrado" } | No user exists with the given username |
401 | { "error": "Contraseña incorrecta" } | Username found but password hash does not match |
401 | { "error": "Token requerido" } | Authorization header is absent or empty |
401 | { "error": "Token inválido" } | Token is expired, malformed, or signed with a different secret |