FridgeRadar secures its API with JSON Web Tokens (JWT) signed using the HS256 algorithm. Every request to a protected endpoint must carry a valid token in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EstefanoARG/FridgeRadar/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header. The flow is straightforward: register an account, exchange credentials for a token at the login endpoint, then attach that token to subsequent requests. This page walks through each step with complete examples.
How It Works
The authentication layer is implemented withpython-jose and passlib (bcrypt). When you log in, the server mints a signed JWT containing your id_usuario as the sub claim and an exp claim set to the configured expiry time. On every protected request the server decodes and verifies the token — no session state is stored server-side.
Register an Account
Create a new FridgeRadar account by sending a JSON Request bodycurl exampleResponse — 201 Created
POST request to /api/v1/auth/register. Email addresses must be unique.EndpointThe user’s first name (or full name).
The user’s surname(s). Optional — may be omitted or set to
null.A valid email address. Must be unique across all registered accounts.
The account password. Stored as a bcrypt hash — never in plain text.
Auto-generated primary key for the new user account.
The first name as submitted during registration.
The surname(s), or
null if not provided.The confirmed email address for the account.
Initial account status, typically
"activo".Timestamp of when the account was created, in UTC.
Log In and Obtain a Token
Exchange your credentials for a JWT access token. The login endpoint follows the OAuth2 Password flow, so the request body must be form-encoded — not JSON.EndpointForm fieldscurl exampleResponse — 200 OKStore the
Your account’s email address. The OAuth2 spec names this field
username even though FridgeRadar uses email addresses as identifiers.Your account password in plain text (transmitted over HTTPS).
The signed JWT to include in all subsequent authenticated requests.
Always
"bearer".access_token value — you will attach it to every protected request.Authenticate Requests
Pass the token in the curl example — fetching the current user’s profileToken expiryTokens are valid for
Authorization header using the Bearer scheme. The header must be present on every call to a protected endpoint.ACCESS_TOKEN_EXPIRE_MINUTES minutes from the moment of issue. The default value is 1440 minutes (24 hours). Once a token expires you must log in again to obtain a fresh one.Error Responses
| Status | Scenario | detail value |
|---|---|---|
401 Unauthorized | Token is missing, malformed, or expired | "Token inválido o expirado" |
400 Bad Request | Email or password is incorrect at login | Error message from the auth service |
422 Unprocessable Entity | Login request body was not form-encoded, or a required registration field is absent | Pydantic validation error array |
401 response always includes the WWW-Authenticate: Bearer header, signalling to OAuth2-aware clients that a Bearer token is required.
Security Considerations
Generate a strong secret with:SECRET_KEY in your deployment environment. The ALGORITHM (HS256) and ACCESS_TOKEN_EXPIRE_MINUTES (1440) values can also be overridden via environment variables if your security policy requires shorter-lived tokens.