The historical search module (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BladimirGS/judicial-backend/llms.txt
Use this file to discover all available pages before exploring further.
/api/busquedas/historico) queries the ApelacionHistorico entity — a separate database table that stores legacy and archived appeal records migrated from prior court systems. These records have a simpler structure than current-system appeals and are optimized for historical lookups by case number, party name, offense type, and date range. All endpoints require a valid JWT bearer token.
Historical records are stored in the
ApelacionHistorico table, which is distinct from the current Apelacion table queried by /api/busquedas. Fields, relationships, and completeness may differ from active records.Endpoints overview
| Method | Path | Description |
|---|---|---|
GET | /api/busquedas/historico/filtros | Retrieve filter catalogs for historical search |
GET | /api/busquedas/historico | Search historical appeals with filters and pagination |
GET | /api/busquedas/historico/exportar-excel | Export historical results as an Excel file |
GET | /api/busquedas/historico/exportar-pdf | Export historical results as a PDF file |
GET /api/busquedas/historico/filtros
Returns the catalog values available for filtering historical records. The historical catalog is smaller than the full-mode catalog — onlysalas are provided, as other lookup tables (nomenclaturas, tipos de apelación) are not applicable to the legacy schema.
Authentication: Authorization: Bearer <token>
Response 200
Always
"success" on a successful request.Historical filter catalogs.
Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid Authorization bearer token. |
GET /api/busquedas/historico
Searches theApelacionHistorico table and returns a paginated list of historical appeal records. Supports filtering by case numbers, party names, offense type, and two independent date ranges (reception date and appeal date).
Authentication: Authorization: Bearer <token>
At least one search filter (beyond
page and limit) must be provided. Requests that supply only pagination parameters — or no parameters at all — will receive a 400 Bad Request response. The filter set is validated using HistoricoFiltrosDTO.tieneFiltros().Query parameters
Page number for pagination. Starts at
1.Number of results per page.
Filter by the originating criminal cause docket number.
Filter by the historical toca (appeal folio) identifier.
Filter by sala ID. Use the catalog values returned by
GET /api/busquedas/historico/filtros.Start date of the reception date range filter. ISO 8601 format:
YYYY-MM-DD. Must be used together with fechaRecepcionFinal for a bounded range.End date of the reception date range filter. ISO 8601 format:
YYYY-MM-DD.Start date of the appeal filing date range filter. ISO 8601 format:
YYYY-MM-DD. Independent of the reception date range — both can be applied simultaneously.End date of the appeal filing date range filter. ISO 8601 format:
YYYY-MM-DD.Filter by the name of the accused (imputado). Supports partial text matching.
Filter by the name of the victim (víctima). Supports partial text matching.
Filter by the criminal offense description (delito). Supports partial text matching.
Response 200
"success"Human-readable result message, e.g.
"Operación exitosa".Paginated result envelope.
ApelacionHistoricoDTO fields
Internal primary key of the historical record.
Historical toca / appeal folio number as recorded in the legacy system.
Originating criminal cause docket number.
Date the appeal was received by the court. Format:
YYYY-MM-DD.Date the appeal was formally filed or registered. Format:
YYYY-MM-DD.Name of the accused party in the original proceeding.
Name of the victim in the original proceeding.
Description of the criminal offense charged.
Name of the sala that handled the historical appeal.
Name of the originating trial court.
Error responses
| Status | Meaning |
|---|---|
400 Bad Request | No valid search filters were provided (beyond pagination). |
401 Unauthorized | Missing or invalid Authorization bearer token. |
GET /api/busquedas/historico/exportar-excel
Generates and streams a binary Excel workbook (.xlsx) with all historical records matching the supplied filters. Pagination does not apply — the export includes the full result set.
Authentication: Authorization: Bearer <token>
Query parameters
Same filter parameters asGET /api/busquedas/historico (excluding page and limit): expedienteCausa, toca, idSala, fechaRecepcionInicial, fechaRecepcionFinal, fechaApelacionInicial, fechaApelacionFinal, imputado, victima, delito.
Response 200
- Content-Type:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Content-Disposition:
attachment; filename=historicos.xlsx - Body: Binary Excel file stream.
Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid Authorization bearer token. |
GET /api/busquedas/historico/exportar-pdf
Generates and streams a binary PDF document containing all historical records matching the supplied filters. Authentication:Authorization: Bearer <token>
Query parameters
Same filter parameters asGET /api/busquedas/historico/exportar-excel.
Response 200
- Content-Type:
application/pdf - Content-Disposition:
attachment; filename=historicos.pdf - Body: Binary PDF file stream.
Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid Authorization bearer token. |