Spanish Total.js
English
Documentation For AI agents
Contents

REST API overview

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

.md GitHub
On this page

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

Endpoints

Method and pathTokenWhat it does
POST /API tokenSend a log.
POST /api/Primary access tokenRead, remove and clear logs.
GET /api/download/Primary access tokenDownload the log file.

Send the token

Send the token in one of two ways:

  • in the x-token header:
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:
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):

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:

{"success":true}

Errors come back as a JSON array or, for a wrong token, an HTML page. See Errors.

Made in Europe