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.

The docentes endpoints manage the teacher roster stored in the usuarios service. Teachers can only read their own record; administrators can view the full list and perform all write operations. A separate set of internal routes (prefixed /internal/) allows other microservices to look up teacher data using a shared INTERNAL_API_KEY without requiring a user JWT. Base URL: http://localhost:8001

GET /docentes

Returns teacher records based on the caller’s role. Requires a valid JWT.
  • ADMIN: Returns all teachers.
  • DOCENTE: Returns only the record for the authenticated teacher.

Headers

Authorization
string
required
Bearer <token> obtained from POST /auth/login.

Response

An array of teacher objects.
id
integer
Primary key.
matricula
string | null
Optional employee or staff ID.
nombre
string
Display name.
correo
string
Email address.
rol
string
DOCENTE or ADMIN.
turno
string
Teaching shift: MATUTINO, VESPERTINO, or AMBOS.
estado
boolean
Whether the account is active.
curl -s http://localhost:8001/docentes \
  -H "Authorization: Bearer eyJ..."

POST /docentes

Creates a new teacher account. ADMIN only. This is the admin-managed counterpart to the self-service /auth/register endpoint — it supports the same body fields and allows setting any role value because the caller is already authenticated as an admin.

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Request body

nombre
string
required
Full display name.
correo
string
required
Email address. Must be unique.
password
string
required
Plain-text password. Stored as a bcrypt hash.
role
string
default:"DOCENTE"
DOCENTE or ADMIN.
matricula
string
Optional staff ID.
turno
string
default:"AMBOS"
MATUTINO, VESPERTINO, or AMBOS.

Response

Returns the created teacher object (same shape as GET /docentes).
curl -s -X POST http://localhost:8001/docentes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJ..." \
  -d '{
    "nombre": "Luis Pérez",
    "correo": "[email protected]",
    "password": "p4ssw0rd!",
    "role": "DOCENTE",
    "turno": "VESPERTINO"
  }'

PUT /docentes/

Partially or fully updates a teacher’s record. Only the fields included in the request body are changed. Requires ADMIN role. If password is included it is re-hashed before storage.

Path parameters

docente_id
integer
required
ID of the teacher to update.

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Request body (all fields optional)

nombre
string
New display name.
correo
string
New email address.
password
string
New plain-text password. Will be hashed.
role
string
New role: DOCENTE or ADMIN.
matricula
string
New staff ID.
turno
string
New shift: MATUTINO, VESPERTINO, or AMBOS.
estado
boolean
Set false to deactivate the account.

Response

Returns the updated teacher object.
curl -s -X PUT http://localhost:8001/docentes/10 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJ..." \
  -d '{
    "turno": "MATUTINO",
    "estado": false
  }'

DELETE /docentes/

Deletes a teacher account permanently. Requires ADMIN role.

Path parameters

docente_id
integer
required
ID of the teacher to delete.

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Response

Empty response body.
curl -s -X DELETE http://localhost:8001/docentes/10 \
  -H "Authorization: Bearer eyJ..."

Internal routes

Two additional routes are available exclusively for inter-service communication. They require the X-Internal-Key header instead of a user JWT.
MethodPathDescription
GET/internal/docentesReturns all teacher records
GET/internal/docentes/{docente_id}Returns one teacher record by ID
Internal routes must not be exposed publicly. They are intended only for service-to-service calls within the same private network. The INTERNAL_API_KEY should be kept secret and rotated regularly.

Build docs developers (and LLMs) love