Documentation · API reference
POST/api/v1/sites/{site}/events/batch

Send events in a batch

Up to 500 events in one request. A malformed one refuses the batch before any of it is counted.

What to send

A list of EventIn An event sent from a backend (IN-09), counted on the same model as one the script sends.

currency
string or null
name
string or nullThe event's name. Leave it out to count a view.
props
object
referrer
string or null
url
stringneededThe page it happened on: a full address on one of the site's hostnames.
value
number or nullAn amount with its currency: `{ "amount": 29.0, "currency": "EUR" }`.
visitor
EventVisitor or null

The answer

Status 202

EventsTaken What became of a batch of events.

counted
integerneeded
left_out
integerneeded
repeated
booleanneededThe whole batch was sent before under the same key, and counts nothing.
why
objectneededWhy, and how many for each reason.

Asking

With your token from Settings
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/events/batch \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"url": "…"}'
With your token from Settings
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/events/batch", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"url": "…"}),
}).then((r) => r.json());