Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danielsl4/TFG_DAM_2526/llms.txt

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

The /login endpoint validates credentials and returns a signed JWT. Pass this token in the Authorization header as Bearer <token> on every subsequent request that requires authentication. Token lifetime depends on the account role: 7 days for regular users, 6 hours for admin and referee accounts. This endpoint is rate-limited to 10 requests per IP address per 15-minute window using a Redis-backed store. Exceeding the limit returns a 429 Too Many Requests response.

Request

Method: POST
Path: /login

Body parameters

username
string
required
The account’s username, as provided during registration.
password
string
required
The account’s plain-text password. Verified against the stored bcrypt hash.

Response

200 OK

Credentials are valid. The response contains a single JWT field.
token
string
Signed JWT. Use as Authorization: Bearer <token> in requests to protected endpoints. Expiry: 7 days for user role, 6 hours for admin and referee roles.

Errors

StatusCondition
400 Bad Requestusername or password is missing from the request body.
401 UnauthorizedNo account found for the given username, or the password does not match. The response message is intentionally identical for both cases to prevent user enumeration.
429 Too Many RequestsRate limit exceeded. Retry after 15 minutes.
500 Internal Server ErrorDatabase error or JWT signing failure.

Example

TOKEN=$(curl --silent --request POST \
  --url https://api.futsalmanager.example/login \
  --header 'Content-Type: application/json' \
  --data '{"username": "jdoe", "password": "s3cur3P@ssw0rd"}' \
  | jq -r '.token')

# Use the token in a subsequent request
curl --request GET \
  --url https://api.futsalmanager.example/matches \
  --header "Authorization: Bearer $TOKEN"
200 response
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Build docs developers (and LLMs) love