Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSebax85/backend-prueba-fullstack/llms.txt

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

The /materias resource manages academic subjects. Each subject has a unique auto-generated ID, a name, a unique code, and a credit value. All five CRUD operations are supported.

GET /materias

Returns all subjects in the database as a JSON array. The array is empty if no subjects have been created yet. Response: 200 OK
id
integer
Unique identifier assigned by the database. Auto-generated.
nombre
string
Subject name.
codigo
string
Subject code (e.g., MAT101).
creditos
integer
Number of academic credits the subject is worth.
curl example
curl http://localhost:8080/materias
Example response
[
  {
    "id": 1,
    "nombre": "Matemáticas",
    "codigo": "MAT101",
    "creditos": 4
  },
  {
    "id": 2,
    "nombre": "Historia",
    "codigo": "HIS201",
    "creditos": 3
  }
]

POST /materias

Creates a new subject. Any id value you include in the request body is ignored — the API forces the ID to null and lets the database assign one. Request body
nombre
string
required
Subject name.
codigo
string
required
Subject code (e.g., MAT101). Must be unique across all subjects.
creditos
integer
required
Number of academic credits the subject is worth.
Response: 200 OK — the saved subject object including the assigned id.
id
integer
Auto-generated identifier assigned by the database.
nombre
string
Subject name.
codigo
string
Subject code.
creditos
integer
Number of academic credits.
Do not include an id field in the request body. The API ignores it and always assigns a new ID automatically.
curl example
curl -X POST http://localhost:8080/materias \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Matemáticas",
    "codigo": "MAT101",
    "creditos": 4
  }'
Example request body
{
  "nombre": "Matemáticas",
  "codigo": "MAT101",
  "creditos": 4
}
Example response
{
  "id": 1,
  "nombre": "Matemáticas",
  "codigo": "MAT101",
  "creditos": 4
}

GET /materias/

Returns a single subject by its numeric ID. Path parameters
id
integer
required
The unique identifier of the subject to retrieve.
Response: 200 OK — the subject object.
id
integer
Unique identifier.
nombre
string
Subject name.
codigo
string
Subject code.
creditos
integer
Number of academic credits.
Error cases
StatusCondition
404 Not FoundNo subject exists with the given id.
curl example
curl http://localhost:8080/materias/1
Example response
{
  "id": 1,
  "nombre": "Matemáticas",
  "codigo": "MAT101",
  "creditos": 4
}

PUT /materias/

Updates an existing subject’s fields. All three editable fields — nombre, codigo, and creditos — are overwritten with the values from the request body. Path parameters
id
integer
required
The unique identifier of the subject to update.
Request body
nombre
string
required
Updated subject name.
codigo
string
required
Updated subject code.
creditos
integer
required
Updated number of academic credits.
Response: 200 OK — the updated subject object.
id
integer
Unchanged unique identifier.
nombre
string
Updated subject name.
codigo
string
Updated subject code.
creditos
integer
Updated number of academic credits.
Error cases
StatusCondition
404 Not FoundNo subject exists with the given id.
curl example
curl -X PUT http://localhost:8080/materias/1 \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Matemáticas Avanzadas",
    "codigo": "MAT102",
    "creditos": 5
  }'
Example request body
{
  "nombre": "Matemáticas Avanzadas",
  "codigo": "MAT102",
  "creditos": 5
}
Example response
{
  "id": 1,
  "nombre": "Matemáticas Avanzadas",
  "codigo": "MAT102",
  "creditos": 5
}

DELETE /materias/

Deletes a subject by ID. Path parameters
id
integer
required
The unique identifier of the subject to delete.
Response: 204 No Content — the subject was deleted. The response body is empty. Error cases
StatusCondition
404 Not FoundNo subject exists with the given id.
Unlike DELETE /alumnos/{id}, deleting a subject does not check for associated grades first. However, any grades (notas) that reference the deleted subject will become orphaned — those notas are automatically excluded from the GET /notas list response. Delete grades before deleting their subject to keep your data consistent.
curl example
curl -X DELETE http://localhost:8080/materias/1
Successful response: 204 No Content with an empty body.

Alumnos reference

Endpoints for managing student records.

Notas reference

Endpoints for creating, reading, and deleting grades.

Error reference

Full list of status codes and how to handle them.

API overview

Base URL, authentication, CORS, and content type.

Build docs developers (and LLMs) love