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 /register endpoint creates a new user account and returns a signed JWT so your client can authenticate immediately without a separate login step. All new accounts are assigned the user role by default. 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: /register

Body parameters

username
string
required
Unique display name for the account. Must not already exist in the system.
email
string
required
Email address for the account. Must not already be registered.
password
string
required
Plain-text password. Stored as a bcrypt hash (cost factor 10). Minimum length is not enforced by the API but short passwords are strongly discouraged.

Response

201 Created

Account was created successfully. The response includes the new user object and a ready-to-use JWT.
message
string
Human-readable confirmation, e.g. "User registered successfully".
user
object
token
string
Signed JWT. Include this in subsequent requests as Authorization: Bearer <token>. Expires in 7 days for user role accounts (6 hours for admin and referee).

Errors

StatusCondition
400 Bad RequestOne or more of username, email, or password is missing from the request body.
409 ConflictThe username or email is already taken by an existing account.
429 Too Many RequestsRate limit exceeded. Retry after 15 minutes.
500 Internal Server ErrorDatabase error or JWT signing failure.

Example

curl --request POST \
  --url https://api.futsalmanager.example/register \
  --header 'Content-Type: application/json' \
  --data '{
    "username": "jdoe",
    "email": "[email protected]",
    "password": "s3cur3P@ssw0rd"
  }'
201 response
{
  "message": "User registered successfully",
  "user": {
    "id": 42,
    "username": "jdoe",
    "email": "[email protected]",
    "role": "user"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Build docs developers (and LLMs) love