An academic period (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.
AcademicPeriod) represents a discrete interval of instruction — a school year, a semester, a trimester, or any other term the school defines. Every record that tracks student progress (enrollments, grades, attendance) is scoped to one academic period. Only one period may be active at a time per tenant; activating a new period automatically deactivates all others for that school.
Periods are identified by a human-readable nombre (name), a start date (fecha_inicio), and an end date (fecha_fin), all of which are scoped to the authenticated user’s tenant_id. Directors have full CRUD access; professors can read periods and retrieve the currently active one.
All endpoints require an active Sanctum token. Include
Authorization: Bearer <token> on every request.GET /api/periodos
Returns all academic periods belonging to the authenticated user’s tenant. Authentication required:Authorization: Bearer <token> — role director or profesor
Response 200 OK
Returns a JSON array of academic period objects.
Unique period ID.
Name of the period. Example:
"2026-I".Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Whether this period is currently active.
The tenant this period belongs to.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
Example
GET /api/periodos/activo
Returns the single period currently marked asactivo = true for the authenticated user’s tenant. If no active period exists, the endpoint returns 404.
Authentication required: Authorization: Bearer <token> — role director or profesor
Response 200 OK
Returns the active academic period object (same shape as a single item from GET /api/periodos).
Error 404 Not Found
Example
POST /api/periodos
Creates a new academic period for the authenticated director’s tenant. Ifactivo is set to true, all other periods in the same tenant are automatically deactivated.
Authentication required: Authorization: Bearer <token> — role director
Request body
Name of the academic period. Must be unique within the
academic_periods table. Example: "2026-II".Start date of the period. Must be a valid date in
YYYY-MM-DD format.End date of the period. Must be a valid date after
fecha_inicio.Optional. Defaults to
false. If true, all other periods for this tenant are deactivated before the new period is created.Response 201 Created
Returns the newly created academic period object.
Auto-generated period ID.
Period name as provided.
Start date.
End date.
Activation status.
The tenant this period was created under.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
Example
GET /api/periodos/
Returns a single academic period by its numeric ID. Authentication required:Authorization: Bearer <token> — role director
Path parameters
The numeric ID of the academic period to retrieve.
Response 200 OK
Returns the academic period object. Returns 404 if the ID does not exist.
Example
PUT /api/periodos/
Updates an existing academic period. Supports two modes:- Full update: provide
nombre,fecha_inicio,fecha_fin, and optionallyactivo. All required fields are validated. - Status-only update: provide only
activo(single key). Skips name/date validation and just toggles the active flag.
activo value is true, all other periods in the tenant are set to activo = false.
Authentication required: Authorization: Bearer <token> — role director
Path parameters
The numeric ID of the academic period to update.
Request body
Updated name for the period. Required when doing a full update. Ignored in status-only mode.
Updated start date in
YYYY-MM-DD format. Required when doing a full update.Updated end date. Must be after
fecha_inicio. Required when doing a full update.Optional. If this is the only key sent, the endpoint performs a status-only update. If included alongside the other fields, it sets the activation status as part of the full update.
Response 200 OK
Returns the updated academic period object.
Example — full update
Example — status-only update
DELETE /api/periodos/
Permanently deletes an academic period record. Authentication required:Authorization: Bearer <token> — role director
Path parameters
The numeric ID of the academic period to delete.
Response 200 OK
Confirmation string. Example:
"Periodo eliminado correctamente".Example
PATCH /api/periodos//activar
Activates the specified academic period. This is the canonical way to switch the active period: all other periods for the tenant are set toactivo = false before the target period is set to activo = true. This guarantees at most one active period per tenant at all times.
Authentication required: Authorization: Bearer <token> — role director
This endpoint is the preferred way to activate a period. It is equivalent to
PUT /api/periodos/{id} with { "activo": true } as the only key, but is more explicit and does not require knowing the status-only update behavior of PUT.Path parameters
The numeric ID of the academic period to activate.
Response 200 OK
Confirmation string. Example:
"Periodo activado correctamente".The updated academic period record with
activo set to true.