Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/iamalexis689725/cole/llms.txt

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

An inscripción (enrollment) is the record that places a student into a specific course and section within an academic period. Cole enforces a single enrollment per student per period — a student cannot be enrolled in two different courses simultaneously within the same period. The academic period must also be active (activo = true) before new enrollments can be created. Directors manage the full lifecycle of enrollments. Professors can query the roster of students enrolled in their specific class section. All requests require a valid Bearer token. Director endpoints require role:director; the teacher roster endpoint requires role:profesor.

Inscripciones (Director)

List Enrollments

Requires role:director.
GET /api/periodos/{periodo}/inscripciones
Returns all enrollment records for the given academic period, with the student’s user account, course, section, and period loaded. Path Parameters
periodo
integer
required
The ID of the academic period.
Example Request
curl -X GET https://your-domain.com/api/periodos/1/inscripciones \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Example Response
[
  {
    "id": 1,
    "estudiante_id": 1,
    "curso_id": 1,
    "paralelo_id": 1,
    "academic_period_id": 1,
    "tenant_id": 1,
    "estudiante": {
      "id": 1,
      "codigo_estudiante": "EST-001",
      "user": {
        "id": 5,
        "name": "María García",
        "email": "mgarcia@school.edu"
      }
    },
    "curso": { "id": 1, "nombre": "Décimo", "nivel": "Básica Superior" },
    "paralelo": { "id": 1, "nombre": "A", "turno": "Matutino" },
    "periodo": { "id": 1, "nombre": "2026-2027" }
  }
]

Get Enrollment

Requires role:director.
GET /api/periodos/{periodo}/inscripciones/{id}
Returns a single enrollment record with all relationships loaded. Path Parameters
periodo
integer
required
The ID of the academic period.
id
integer
required
The ID of the enrollment.
Example Request
curl -X GET https://your-domain.com/api/periodos/1/inscripciones/1 \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"

Create Enrollment

Requires role:director. The academic period must be active.
POST /api/periodos/{periodo}/inscripciones
Enrolls a student in a course and section within the specified academic period. The API validates:
  • The paralelo_id belongs to the given curso_id.
  • The student is not already enrolled in any course within this period (one enrollment per student per period).
  • The academic period is active.
Path Parameters
periodo
integer
required
The ID of the academic period.
Request Body
estudiante_id
integer
required
ID of the student to enroll. Must belong to the authenticated tenant.
curso_id
integer
required
ID of the course the student is being placed in. Must belong to the tenant.
paralelo_id
integer
required
ID of the section within the course. Must belong to both the tenant and the given curso_id.
Example Request
curl -X POST https://your-domain.com/api/periodos/1/inscripciones \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "estudiante_id": 1,
    "curso_id": 1,
    "paralelo_id": 1
  }'
Example Response 201 Created
{
  "message": "Inscripción creada",
  "data": {
    "id": 1,
    "estudiante_id": 1,
    "curso_id": 1,
    "paralelo_id": 1,
    "academic_period_id": 1,
    "tenant_id": 1,
    "estudiante": {
      "id": 1,
      "codigo_estudiante": "EST-001",
      "user": {
        "id": 5,
        "name": "María García",
        "email": "mgarcia@school.edu"
      }
    },
    "curso": { "id": 1, "nombre": "Décimo", "nivel": "Básica Superior" },
    "paralelo": { "id": 1, "nombre": "A", "turno": "Matutino" },
    "periodo": { "id": 1, "nombre": "2026-2027" }
  }
}
message
string
Human-readable confirmation message.
data
object
The created enrollment with all relationships loaded.
data.id
integer
Internal ID of the enrollment record.
data.estudiante_id
integer
ID of the enrolled student.
data.curso_id
integer
ID of the assigned course.
data.paralelo_id
integer
ID of the assigned section.
data.academic_period_id
integer
ID of the academic period this enrollment belongs to.
data.estudiante
object
The student record with nested user (name and email).
data.curso
object
The course record (id, nombre, nivel).
data.paralelo
object
The section record (id, nombre, turno).
data.periodo
object
The academic period record (id, nombre).
Error Responses
StatusCondition
403 ForbiddenThe academic period is inactive.
409 ConflictThe student is already enrolled in this academic period.
422 Unprocessable EntityThe paralelo_id does not belong to the given curso_id; or a referenced ID was not found within the tenant.

Update Enrollment

Requires role:director.
PUT /api/periodos/{periodo}/inscripciones/{id}
Updates an existing enrollment to change the student’s assigned course or section. All fields are optional; only provided fields are updated. If both curso_id and paralelo_id are changed, the new paralelo must belong to the new curso. The uniqueness constraint (one enrollment per student per period) is also re-validated. Path Parameters
periodo
integer
required
The ID of the academic period.
id
integer
required
The ID of the enrollment to update.
Request Body
estudiante_id
integer
Updated student ID. Must belong to the tenant. Cannot match another enrollment for this period.
curso_id
integer
Updated course ID. Must belong to the tenant.
paralelo_id
integer
Updated section ID. Must belong to the tenant and to the effective curso_id.
Example Request
curl -X PUT https://your-domain.com/api/periodos/1/inscripciones/1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{ "paralelo_id": 2 }'
Example Response 200 OK
{
  "message": "Inscripción actualizada",
  "data": {
    "id": 1,
    "estudiante_id": 1,
    "curso_id": 1,
    "paralelo_id": 2,
    "academic_period_id": 1,
    "tenant_id": 1,
    "estudiante": {
      "id": 1,
      "codigo_estudiante": "EST-001",
      "user": { "id": 5, "name": "María García", "email": "mgarcia@school.edu" }
    },
    "curso": { "id": 1, "nombre": "Décimo", "nivel": "Básica Superior" },
    "paralelo": { "id": 2, "nombre": "B", "turno": "Matutino" },
    "periodo": { "id": 1, "nombre": "2026-2027" }
  }
}
Error Responses
StatusCondition
409 ConflictThe updated estudiante_id is already enrolled in this period in a different enrollment record.
422 Unprocessable EntityThe resolved paralelo_id does not belong to the resolved curso_id.

Delete Enrollment

Requires role:director.
DELETE /api/periodos/{periodo}/inscripciones/{id}
Removes the enrollment record. This does not delete the student profile. Path Parameters
periodo
integer
required
The ID of the academic period.
id
integer
required
The ID of the enrollment to delete.
Example Request
curl -X DELETE https://your-domain.com/api/periodos/1/inscripciones/1 \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Example Response 200 OK
{ "message": "Inscripción eliminada" }

Enrolled Students by Class (Professor)

List Students for a Class Section

Requires role:profesor.
GET /api/periodos/{periodo}/cursos/{curso}/paralelos/{paralelo}/estudiantes
Returns the list of students enrolled in a specific course section within a period. This endpoint is designed for teachers to access their class roster. Each entry contains the student’s internal ID, full name, and email address. Path Parameters
periodo
integer
required
The ID of the academic period.
curso
integer
required
The ID of the course.
paralelo
integer
required
The ID of the section.
Example Request
curl -X GET https://your-domain.com/api/periodos/1/cursos/1/paralelos/1/estudiantes \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Example Response
{
  "periodo_id": 1,
  "curso_id": 1,
  "paralelo_id": 1,
  "estudiantes": [
    {
      "id": 1,
      "nombre": "María García",
      "email": "mgarcia@school.edu"
    },
    {
      "id": 2,
      "nombre": "José López",
      "email": "jlopez@school.edu"
    }
  ]
}
periodo_id
integer
The academic period ID used in the query.
curso_id
integer
The course ID used in the query.
paralelo_id
integer
The section ID used in the query.
estudiantes
array
Ordered list of enrolled students (sorted by inscription ID ascending).
estudiantes[].id
integer
The student’s internal ID.
estudiantes[].nombre
string
Student’s full name from the linked user account.
estudiantes[].email
string
Student’s email address.

Build docs developers (and LLMs) love