Spanish Total.js
English
Documentation For AI agents
Contents

Send a log

POST / stores one log: the fields, their limits and an example.

.md GitHub
On this page

POST / stores one log. Send it with an API token.

Request

curl -H "x-token: YOUR_TOKEN" -H "content-type: application/json" \
  -d '{
    "app": "Demo project",
    "type": "error",
    "schema": "Reports",
    "message": "Report export failed: timeout",
    "userid": "u101",
    "username": "John Smith",
    "url": "https://app.example.com/reports/",
    "ip": "198.51.100.7",
    "ua": "Chrome 131 (Windows)",
    "data": "{\"report\":\"monthly\",\"timeout\":30000}"
  }' \
  https://logs.example.com/

Response 200:

{"success":true}

Fields

FieldRequiredMax. lengthWhat it holds
appyes40The name of the app, for example Demo project. Shown in App.
typenoinfo, warning, error or success, in lower case. Any other value, or none, is stored as info.
messageno500The text of the log.
schemano50The part of the app, for example Orders or Users.
useridno30The ID of the user.
usernameno50The name of the user.
urlno100The address the user was on.
ipno80The IP address of the user.
uano30The device or browser, shown in Device.
datanoExtra data as a JSON string. Shown formatted in Log detail.
referenceno50Your own reference, for example an order number. Only in the downloaded file.
datenoThe time of the event, as an ISO date. Only in the downloaded file. Without it, the time of arrival is used.
clientsidenotrue if the event happened in the browser. Only in the downloaded file.

OpenLogger adds id and dtcreated, the time it received the log. Other fields are ignored.

Rules

  • A longer value is cut to the maximum length, without an error.
  • data must be a string. Turn an object into JSON first, for example with JSON.stringify() in JavaScript. An object sent as it is gets stored empty.
  • Without app, the request fails with 400. See Errors.
Made in Europe