Overview
Sections represent academic grades or levels in the educational system. Each section has a grade level and a name, and can be associated with multiple units. Sections are the top-level organizational structure for academic content.
Endpoints
List All Sections
curl -X GET "https://api.example.com/api/sections" \
-H "Accept: application/json"
Response
Indicates if the request was successful
Response message: “Secciones listado con éxito”
Array of section objects Unique identifier for the section
Grade or level designation
When the section was created
When the section was last updated
{
"success" : true ,
"message" : "Secciones listado con éxito" ,
"data" : [
{
"id" : 1 ,
"grado" : "1ro" ,
"nombre" : "Primer Grado" ,
"created_at" : "2026-03-05T10:30:00.000000Z" ,
"updated_at" : "2026-03-05T10:30:00.000000Z"
},
{
"id" : 2 ,
"grado" : "2do" ,
"nombre" : "Segundo Grado" ,
"created_at" : "2026-03-05T10:31:00.000000Z" ,
"updated_at" : "2026-03-05T10:31:00.000000Z"
}
]
}
Create a Section
curl -X POST "https://api.example.com/api/sections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"grado": "3ro",
"nombre": "Tercer Grado"
}'
Request Body
Response
Indicates if the request was successful
Response message: “Sección creado con éxito”
The created section object Unique identifier for the section
Grade or level designation
When the section was created
When the section was last updated
Example Response (201 Created)
{
"success" : true ,
"message" : "Sección creado con éxito" ,
"data" : {
"id" : 3 ,
"grado" : "3ro" ,
"nombre" : "Tercer Grado" ,
"created_at" : "2026-03-05T10:35:00.000000Z" ,
"updated_at" : "2026-03-05T10:35:00.000000Z"
}
}
Get a Section
curl -X GET "https://api.example.com/api/sections/1" \
-H "Accept: application/json"
Path Parameters
Response
Indicates if the request was successful
Response message: “Sección obtenido con éxito”
The section object Unique identifier for the section
Grade or level designation
When the section was created
When the section was last updated
{
"success" : true ,
"message" : "Sección obtenido con éxito" ,
"data" : {
"id" : 1 ,
"grado" : "1ro" ,
"nombre" : "Primer Grado" ,
"created_at" : "2026-03-05T10:30:00.000000Z" ,
"updated_at" : "2026-03-05T10:30:00.000000Z"
}
}
Update a Section
curl -X PUT "https://api.example.com/api/sections/1" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"grado": "1ro Avanzado",
"nombre": "Primer Grado Avanzado"
}'
Path Parameters
Request Body
Response
Indicates if the request was successful
Response message: “Sección actualizado con éxito”
The updated section object Unique identifier for the section
Grade or level designation
When the section was created
When the section was last updated
{
"success" : true ,
"message" : "Sección actualizado con éxito" ,
"data" : {
"id" : 1 ,
"grado" : "1ro Avanzado" ,
"nombre" : "Primer Grado Avanzado" ,
"created_at" : "2026-03-05T10:30:00.000000Z" ,
"updated_at" : "2026-03-05T11:45:00.000000Z"
}
}
Delete a Section
curl -X DELETE "https://api.example.com/api/sections/1" \
-H "Accept: application/json"
Path Parameters
Response
Indicates if the request was successful
Response message: “Sección eliminado con éxito”
Returns null for successful deletions
{
"success" : true ,
"message" : "Sección eliminado con éxito" ,
"data" : null
}
Relationships
Units
A section can have many units. When a section is deleted, all associated units are automatically deleted (cascade delete).
Database Schema
The sections table includes:
id - Primary key (auto-increment)
grado - String field for grade designation
nombre - String field for section name
created_at - Timestamp for creation
updated_at - Timestamp for last update