---
title: Reports API
project: Panel de control
version: 1.0
section: reference
language: es
translation: missing
license: Total.js Enterprise
url: https://totaljs.es/docs/es/dashboard/1-0/reference/reports-api/
updated: 2026-11-20T06:40:32.732Z
---

# Reports API

> Read the list of reports and their data over HTTP with a token.

Other programs can list your reports and load their data over HTTP. The API is off until you turn it on in the `config` file.

## Turn it on

1. Add these keys to the file `config`, with your own long random token:

```text
api                 : true
token               : 3f9c0d1e8b7a4c2f9e6d5a4b3c2d1e0f
```

2. Restart Dashboard.

Send the token with every request, in the header `x-token` or in the query argument `token`. Without the right token, or while the API is off, the API answers `401: Unauthorized`.

[Private reports](../../guides/reports/) are not listed and cannot be loaded through the API.

## List reports

`GET /reports/` returns the reports with their fields and their [dynamic filters](/openreports/1-0/guides/dynamic-filters/).

```bash
curl -H 'x-token: 3f9c0d1e8b7a4c2f9e6d5a4b3c2d1e0f' http://localhost:8000/reports/
```

```json
[
	{
		"id": "JasoWU1dx60f",
		"name": "Sales by region",
		"category": "Sales",
		"filter": [],
		"fields": [
			{ "id": "x1jkk54k", "name": "Region", "datatype": "string" },
			{ "id": "amount", "type": "sum", "name": "Amount", "datatype": "number" }
		],
		"chart": true,
		"x": "x1jkk54k",
		"y": "amount",
		"series": ""
	}
]
```

## Load a report

`POST /reports/` with the `id` of the report runs it and returns its fields and rows.

```bash
curl -X POST -H 'x-token: 3f9c0d1e8b7a4c2f9e6d5a4b3c2d1e0f' -H 'Content-Type: application/json' \
	-d '{"id":"JasoWU1dx60f"}' http://localhost:8000/reports/
```

```json
{
	"fields": [
		{ "id": "x1jkk54k", "name": "Region", "datatype": "string" },
		{ "id": "amount", "name": "Amount", "datatype": "number", "type": "sum", "format": 2 }
	],
	"rows": [
		{ "x1jkk54k": "West", "amount": 61627.42 },
		{ "x1jkk54k": "North", "amount": 61365.73 },
		{ "x1jkk54k": "South", "amount": 60752.96 },
		{ "x1jkk54k": "East", "amount": 57640.19 }
	]
}
```

To set the values of dynamic filters, add `"filter": [{ "id": "<field id>", "value": "<value>" }]` to the body.

## Load the chart data

Add `"chart": true` to load the [chart data](../../guides/chart-data/) of a report with **Enable chart view**. The answer is a list of series with points `x` and `y`:

```json
[
	{
		"id": "JasoWU1dx60f",
		"name": "Sales by region",
		"icon": "ti ti-globe",
		"color": "#34A853",
		"data": [
			{ "x": "West", "y": 61627.42 },
			{ "x": "North", "y": 61365.73 },
			{ "x": "South", "y": 60752.96 },
			{ "x": "East", "y": 57640.19 }
		],
		"format": "{0} EUR",
		"decimals": 0
	}
]
```

A report with **Series for** returns one series for each value of that field.

An unknown or private report answers `404: Not Found`.
