---
title: Enable the API
project: OpenReports
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/openreports/1-0/guides/enable-api/
updated: 2026-11-19T07:46:43.909Z
---

# Enable the API

> Turn on the API for reading reports and create its token.

Other programs can list your reports and load their data over HTTP. The API is off until you turn it on and set a token.

![The API settings in Configuration: Enable API for reading reports, Token, Generate token and Copy link](/files/JapUXf95s60f.webp)

## Turn it on

1. Select **Configuration** in the bar on the left.
2. Select **Enable API for reading reports**.
3. Select **Generate token** to fill **Token** with a long random value, or enter your own.
4. Select **SUBMIT**.

**Copy link** copies the address of the API with the token, for example `http://localhost:8000/reports/?token=...`.

## Send the token

Send the token with every request, in one of these ways:

- the header `x-token`;
- the query argument `token`, as in the copied link.

Without the right token, or while the API is off, the API answers `401: Unauthorized`.

Treat the token like a password: anyone who has it can read every report that is not private. To change it, generate a new one and select **SUBMIT**. Programs that use the old token stop working.

## What you can do

- [List reports](../../reference/api-list-reports/)
- [Load a report](../../reference/api-load-report/)
- [Chart data](../../reference/api-chart/)

[Private reports](../create-report/) cannot be loaded through the API.
