The statistics export endpoint accepts filter criteria in a JSON request body and responds with a binary Excel workbook (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.
.xlsx) containing multiple sheets. Unlike the GET export endpoints in the search module, this endpoint uses a POST method so that filters are transmitted as structured JSON rather than query string parameters. The generated workbook consolidates the flat report, grouped summary, and a chart-ready data sheet into a single download.
Endpoint
Authorization: Bearer <token>
Request body
The request body must be a JSON object with a requiredfiltros key containing the filter criteria, and an optional imagenBase64 key for embedding a chart image into the workbook.
Content-Type: application/json
Filter criteria object. At least one field inside
filtros must be present and non-empty. A request body with an empty filtros object — or a body that omits all filter keys inside it — will receive a 400 Bad Request response.Optional. A Base64-encoded PNG or JPEG image (e.g. a chart screenshot from the client) to embed in the generated workbook. When provided, the image is inserted into one of the Excel sheets alongside the statistical data.
At least one filter field inside
filtros must be present and non-empty. The filter set is validated using EstadisticaFiltrosDTO.tieneFiltros().Example request body
Example request body with chart image
Response 200 — Excel workbook
The response is a binary Excel file stream. The file contains three sheets:
| Sheet name | Content |
|---|---|
| plano | Row-level flat statistical records equivalent to GET /api/estadisticas/plano (unpaginated). |
| agrupado | Summary rows grouped by sala, equivalent to the grupos array from GET /api/estadisticas/agrupado. |
| gráfico | Chart-ready data derived from the grouped data, formatted for direct use as a chart data source in Excel. |
| Header | Value |
|---|---|
Content-Type | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Content-Disposition | attachment; filename=estadisticas.xlsx |
.xlsx file stream. Save the response body directly to a file.
Error responses
| Status | Meaning |
|---|---|
400 Bad Request | The filtros object contains no valid filter fields, or all filter values are empty. |
401 Unauthorized | Missing or invalid Authorization bearer token. |