---
title: REST API overview
project: OpenLogger
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/openlogger/1-0/reference/rest-api/
updated: 2026-11-19T08:02:31.630Z
---

# REST API overview

> The endpoints your apps call, how to send the token and what comes back.

Your apps talk to OpenLogger over HTTP. Every address starts with your OpenLogger address, for example `https://logs.example.com`.

## Endpoints

| Method and path | Token | What it does |
|---|---|---|
| `POST /` | API token | [Send a log](../send-log/). |
| `POST /api/` | Primary access token | [Read, remove and clear logs](../read-logs/). |
| `GET /api/download/` | Primary access token | [Download the log file](../read-logs/). |

## Send the token

Send the token in one of two ways:

- in the `x-token` header:

```bash
curl -H "x-token: YOUR_TOKEN" -H "content-type: application/json" \
  -d '{"app":"Demo project","type":"info","message":"User signed in"}' \
  https://logs.example.com/
```

- or as the `token` query argument:

```bash
curl -H "content-type: application/json" \
  -d '{"app":"Demo project","type":"info","message":"User signed in"}' \
  "https://logs.example.com/?token=YOUR_TOKEN"
```

The header keeps the token out of server logs, so prefer it when your app can set headers.

## Request formats

`POST /` accepts JSON (`application/json`) and form data (`application/x-www-form-urlencoded`):

```bash
curl -H "x-token: YOUR_TOKEN" \
  -d "app=Demo project" -d "message=Nightly backup finished" \
  https://logs.example.com/
```

## What comes back

A stored log answers `200`:

```json
{"success":true}
```

Errors come back as a JSON array or, for a wrong token, an HTML page. See [Errors](../errors/).
