Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Alejandrin08/Hackathon-SPEI/llms.txt

Use this file to discover all available pages before exploring further.

Tokens returned from registration must be stored securely. All subsequent protected requests require the JWT in the Authorization header.

Endpoint

POST http://localhost:5000/api/auth/register
No authentication required. On success, the user is automatically logged in and a JWT token is returned — identical in structure to the login response.

Request body

userName
string
required
Display name for the user. Between 3 and 100 characters.
email
string
required
User’s email address. Must be a valid email format and unique across all accounts.
password
string
required
Account password. Minimum 8 characters, maximum 100.
preferredLanguage
string
Preferred UI language. Defaults to "es-MX".

Response

200 OK

token
string
required
Signed JWT for authenticating subsequent requests.
expiresIn
integer
required
Token lifetime in seconds.

Error responses

StatusDescription
400 Bad RequestValidation error or email already registered.
400
{
  "message": "El usuario ya existe."
}

Examples

curl -X POST http://localhost:5000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "userName": "María González",
    "email": "maria@example.com",
    "password": "SecurePass123!",
    "preferredLanguage": "es-MX"
  }'

Build docs developers (and LLMs) love