Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt

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

The registration endpoint creates a brand-new user account and, in the same transaction, automatically provisions an associated Participant profile using the same username. On success it returns a signed JWT access token (valid for 1 hour) and a refresh token (valid for 7 days) that the client can use immediately to authenticate subsequent requests.

Endpoint

POST /auth/crear
Auth required: None — this endpoint is public.

Request Body

nombre
string
required
The username for the new account. Must be between 6 and 20 characters and must be unique across all registered users. Used as the login identifier — not the email address.
password
string
required
The account password. Must be at least 8 characters long and contain at least one digit (0–9).
email
string
required
A valid email address. Must follow standard email format and must be unique across all registered users.

Request Example

{
  "nombre": "cristian94",
  "password": "securePass1",
  "email": "cristian@example.com"
}

Response

A 200 OK response with a JSON body containing both tokens.
access_token
string
A signed JWT access token. Include this in the Authorization: Bearer <token> header for all protected requests. Default TTL: 1 hour (configurable via JWT_EXPIRATION).
refresh_token
string
A signed JWT refresh token. Use this with POST /auth/refresh to obtain a new token pair once the access token expires. Default TTL: 7 days (configurable via JWT_REFRESH_EXPIRATION).

Response Example

{
  "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjEsIm5vbWJyZSI6ImNyaXN0aWFuOTQiLCJ0aXBvVXNvIjoiQUNDRVNTIiwicm9sZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6ImFiY2QtMTIzNCIsInN1YiI6ImNyaXN0aWFuOTQiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MTcwMDAwMzYwMH0.signature",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjEsIm5vbWJyZSI6ImNyaXN0aWFuOTQiLCJ0aXBvVXNvIjoiUkVGUkVTSCIsInJvbGVzIjpbIlJPTEVfVVNFUiJdLCJqdGkiOiJ4eXotNTY3OCIsInN1YiI6ImNyaXN0aWFuOTQiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MTcwMDYwNDgwMH0.signature"
}

Error Responses

StatusCondition
400 Bad RequestValidation failure — e.g., nombre is shorter than 6 characters, password does not contain a digit, or email is not a valid email format. The response body contains a single mensaje field with the first validation error message.

Error Response Body

{
  "status": 400,
  "mensaje": "La contraseña debe contener al menos un número",
  "timestamp": 1700000000000
}

curl Example

curl -X POST http://localhost:8080/auth/crear \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "cristian94",
    "password": "securePass1",
    "email": "cristian@example.com"
  }'

Registering a user also creates an associated Participant profile with the same username (nombre). This participant profile is required to join events and send messages in the community. Both the user and participant records are created within a single database transaction — if either step fails, neither record is persisted.

Build docs developers (and LLMs) love