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 (prefixedDocumentation 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.
/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
Bearer <token> obtained from POST /auth/login.Response
An array of teacher objects.Primary key.
Optional employee or staff ID.
Display name.
Email address.
DOCENTE or ADMIN.Teaching shift:
MATUTINO, VESPERTINO, or AMBOS.Whether the account is active.
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
Bearer <token> — must decode to rol: ADMIN.Request body
Full display name.
Email address. Must be unique.
Plain-text password. Stored as a bcrypt hash.
DOCENTE or ADMIN.Optional staff ID.
MATUTINO, VESPERTINO, or AMBOS.Response
- 201 — created
- 400 — validation error
- 403 — forbidden
Returns the created teacher object (same shape as
GET /docentes).PUT /docentes/
Partially or fully updates a teacher’s record. Only the fields included in the request body are changed. RequiresADMIN role. If password is included it is re-hashed before storage.
Path parameters
ID of the teacher to update.
Headers
Bearer <token> — must decode to rol: ADMIN.Request body (all fields optional)
New display name.
New email address.
New plain-text password. Will be hashed.
New role:
DOCENTE or ADMIN.New staff ID.
New shift:
MATUTINO, VESPERTINO, or AMBOS.Set
false to deactivate the account.Response
- 200 — updated
- 404 — not found
- 403 — forbidden
Returns the updated teacher object.
DELETE /docentes/
Deletes a teacher account permanently. RequiresADMIN role.
Path parameters
ID of the teacher to delete.
Headers
Bearer <token> — must decode to rol: ADMIN.Response
- 204 — deleted
- 404 — not found
Empty response body.
Internal routes
Two additional routes are available exclusively for inter-service communication. They require theX-Internal-Key header instead of a user JWT.
| Method | Path | Description |
|---|---|---|
GET | /internal/docentes | Returns all teacher records |
GET | /internal/docentes/{docente_id} | Returns one teacher record by ID |