The KERN API uses JWT (JSON Web Token) Bearer authentication for all protected endpoints. Tokens are signed with HS256 and expire after 30 minutes. There is no refresh-token mechanism — callDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jaimegayo/KERNDOCUMENTATION/llms.txt
Use this file to discover all available pages before exploring further.
POST /login again to obtain a new token.
Obtaining a token
There are two ways to get an access token:| Method | Endpoint | When to use |
|---|---|---|
| Register | POST /register | New user — creates an account and returns a token immediately |
| Login | POST /login | Existing user — authenticates with email and password |
LoginResponse shape.
LoginResponse shape
The JSON key is
accessToken (camelCase), not access_token. This is an intentional alias defined in the Pydantic model using Field(..., alias="accessToken").Using the token
Include the token in theAuthorization header of every authenticated request:
Token expiry and renewal
Tokens expire 30 minutes after they are issued. There is no silent refresh. When a token expires:- The API returns
401 Unauthorized. - The client must call
POST /loginwith the user’s email and password to obtain a fresh token. - Store the new
accessTokenand continue making requests.
Special case — username update
PUT /users/update_name returns a full LoginResponse (including a new JWT token) because the username is embedded in the token payload (sub claim). After updating the username, replace the stored token with the new one to avoid immediate 401 errors.
Error responses
Human-readable error message.
| Status | detail value | Cause |
|---|---|---|
401 | "No se pudo validar el token de acceso" | Token is missing, malformed, or expired |
401 | "Email o contraseña incorrectos" | Wrong credentials on login |
400 | "Usuario inactivo" | Account has been disabled |
CORS
The API allows all origins (*) and all HTTP methods, so tokens can be used from any client including web browsers and Android apps.