Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Luisanchez0/modulo_Horario/llms.txt

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

Módulo Horario exposes two registration endpoints. The public /auth/register route creates DOCENTE accounts; attempting to pass role: ADMIN on this route is explicitly blocked and returns 403. To create an ADMIN account you must call /auth/register-admin and supply the X-Admin-Key header whose value must match the ADMIN_CREATION_KEY environment variable on the server. Base URL: http://localhost:8001

POST /auth/register

Creates a DOCENTE user account. Any caller may use this endpoint — no authentication is required.

Request body

nombre
string
required
Full display name of the teacher.
correo
string
required
Email address. Must be unique across all accounts.
password
string
required
Plain-text password. The server stores a bcrypt hash; the original value is never persisted.
role
string
default:"DOCENTE"
Must be DOCENTE. Passing ADMIN returns 403.
matricula
string
Optional staff or employee ID number.
turno
string
default:"AMBOS"
Teaching shift. Accepted values: MATUTINO, VESPERTINO, AMBOS.

Response

id
integer
Auto-assigned primary key.
matricula
string | null
Employee ID if provided.
nombre
string
Display name.
correo
string
Email address.
rol
string
Always DOCENTE for this endpoint.
turno
string
Teaching shift.
estado
boolean
Account active status; true by default.

Example

curl -s -X POST http://localhost:8001/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana García",
    "correo": "[email protected]",
    "password": "s3cr3t0!",
    "role": "DOCENTE",
    "turno": "MATUTINO"
  }'

POST /auth/register-admin

Creates an ADMIN account. The X-Admin-Key header is required and must equal the value of the ADMIN_CREATION_KEY environment variable on the server.

Headers

X-Admin-Key
string
required
Server-side admin creation key. Obtain this value from your deployment configuration.

Request body

Same fields as /auth/register. The server always overrides role to ADMIN regardless of what is sent.

Response

Same shape as the /auth/register response with rol: "ADMIN".

Example

curl -s -X POST http://localhost:8001/auth/register-admin \
  -H "Content-Type: application/json" \
  -H "X-Admin-Key: super-secret-admin-key" \
  -d '{
    "nombre": "Carlos Admin",
    "correo": "[email protected]",
    "password": "adm1n0!"
  }'
The ADMIN_CREATION_KEY should be a long random string and must not be committed to version control. Rotate it if it is ever exposed.

Build docs developers (and LLMs) love