Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miagv/PlataformaEduca/llms.txt

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

The /api/auth/register endpoint creates a new user account in PlataformaEduca. In addition to persisting the core Usuario record, the API automatically creates the corresponding role-specific profile record — a Docente, Estudiante, or Coordinador row — depending on the value of the rol field. This means a single request is sufficient to fully onboard a new user with their associated profile data.

Endpoint

POST /api/auth/register
Authentication: None required — this is a public endpoint. Content-Type: application/json

Request body

nombres
string
required
First name(s) of the user.
apellidos
string
required
Last name(s) of the user.
email
string
required
Email address of the user. Must be unique across all accounts; this value is used as the login identifier.
password
string
required
Plain-text password provided at registration. The API stores this as a BCrypt hash and never returns it in responses.
rol
string
required
Role to assign to the new user. Valid values: COORDINADOR, DOCENTE, ESTUDIANTE, USER, ADMIN. Determines which role-specific profile record is created automatically.

Example request

{
  "nombres": "María",
  "apellidos": "García",
  "email": "maria.garcia@escuela.edu",
  "password": "securePassword123",
  "rol": "DOCENTE"
}
curl --request POST \
  --url https://your-api-host/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '{
    "nombres": "María",
    "apellidos": "García",
    "email": "maria.garcia@escuela.edu",
    "password": "securePassword123",
    "rol": "DOCENTE"
  }'

Response

200 OK

Returns the newly created Usuario object. The password field is nulled out in the response for security.
id
integer
Auto-generated unique identifier for the user.
nombres
string
First name(s) of the registered user.
apellidos
string
Last name(s) of the registered user.
email
string
Email address of the registered user.
password
null
Always null in the response. The BCrypt hash is never exposed through the API.
activo
boolean
Account status. Always true for newly registered accounts.
roles
array
List of role objects assigned to the user.

Example success response

{
  "id": 5,
  "nombres": "María",
  "apellidos": "García",
  "email": "maria.garcia@escuela.edu",
  "password": null,
  "activo": true,
  "roles": [
    { "id": 4, "nombre": "DOCENTE" }
  ]
}

Error responses

StatusCause
500 Internal Server ErrorThe provided email address is already registered, or another validation error occurred. The response body is a JSON map with an "error" key containing the error message.

Side effects

On a successful registration, a role-specific profile record is automatically created in the corresponding table:
rol valueProfile table
DOCENTEdocentes
ESTUDIANTEestudiantes
COORDINADORcoordinadores
USER / ADMINNo additional profile record

Build docs developers (and LLMs) love