Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sdarionicolas-boop/AgroIA-RAG/llms.txt

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

The /lotes endpoints give you read and write access to the informes_lotes and lote_historial tables in the AgroIA PostgreSQL database. The two GET endpoints require no authentication, making them suitable for dashboards and monitoring tools. The DELETE endpoints require Bearer token authentication and are irreversible — deleted data cannot be recovered.

GET /lotes

Returns a summary of every lot registered in informes_lotes, ordered alphabetically by lote_id. No authentication required.

Response

total
integer
Total number of lots in the database.
lotes
array
Array of lot summary objects.

Example

curl http://localhost:8000/lotes
Response
{
  "total": 26,
  "lotes": [
    {
      "lote_id": "INTA_PIVOTE_001",
      "cultivo": "maiz",
      "score_total": 81.4,
      "ndvi_promedio": 0.72,
      "fecha": "2025-11-15",
      "superficie_ha": 48.3
    },
    {
      "lote_id": "POLIGONO_1",
      "cultivo": null,
      "score_total": null,
      "ndvi_promedio": 0.0,
      "fecha": "2026-05-12",
      "superficie_ha": null
    }
  ]
}

GET /lotes/

Returns the full consolidated informe and the paginated historical series for a single lot. No authentication required.

Path parameters

lote_id
string
required
The unique identifier of the lot to retrieve. Must match a value in informes_lotes.lote_id.

Query parameters

limit
integer
default:"5"
Maximum number of historical year records to return from lote_historial, ordered by anio ascending.

Response

lote_id
string
The requested lot identifier.
informe
object
Consolidated agronomic report for the lot.
historial
array
Historical year records from lote_historial, limited to limit rows.

Examples

# Get lot with default 5 history records
curl "http://localhost:8000/lotes/INTA_PIVOTE_001"

# Get lot with up to 10 history records
curl "http://localhost:8000/lotes/INTA_PIVOTE_001?limit=10"
Response
{
  "lote_id": "INTA_PIVOTE_001",
  "informe": {
    "id": 7,
    "fecha": "2025-11-15",
    "ndvi_promedio": 0.72,
    "gdd_acumulados": 1450.5,
    "score_total": 81.4,
    "cv_espacial": 0.12,
    "cultivo": "maiz",
    "superficie_ha": 48.3,
    "metadata": {
      "zonificacion_activa": true,
      "puntos_zona_c": 3
    }
  },
  "historial": [
    {
      "anio": 2023,
      "cultivo": "maiz",
      "ndvi_critico": 0.68,
      "horas_calor": 1380.0,
      "score_total": 78.2,
      "score_vigor": 32.1,
      "score_estabilidad": 24.5,
      "score_limpieza": 15.8,
      "score_clima": 5.8,
      "valido_para_score": true
    }
  ]
}

DELETE /lotes/

Deletes a single lot and all of its historical records. Removes rows from both informes_lotes and lote_historial. Requires Bearer token authentication.

Path parameters

lote_id
string
required
The unique identifier of the lot to delete.

Response

status
string
Always "deleted" on success.
lote_id
string
The deleted lot identifier.
historial_eliminado
integer
Number of rows deleted from lote_historial for this lot.

Example

curl -X DELETE http://localhost:8000/lotes/TEST_LOTE_99 \
  -H "Authorization: Bearer your_secret_key"

DELETE /lotes

Deletes all lots from informes_lotes and all rows from lote_historial. This operation is irreversible. Requires Bearer token authentication.
This endpoint empties both tables entirely. There is no confirmation prompt and no rollback. Use only in development or when a full database reset is intentional.

Response

status
string
Always "cleared" on success.
lotes_eliminados
integer
Total number of lots that were deleted from informes_lotes.

Example

curl -X DELETE http://localhost:8000/lotes \
  -H "Authorization: Bearer your_secret_key"

Build docs developers (and LLMs) love