API reference

Public API

The endpoints your visitors' browsers call. No API key.

Base: https://api.vlozi.app/engagement/e/{site_id}

These are the endpoints the SDK and embed.js call. They take no API key — the site id in the path is what identifies you, and it's public by design.

Why there's no key, and what protects you instead

A browser can't keep a secret. Anything you embed in a page is readable by anyone who views source, so a key there would be theatre. What actually stands in for it:

Origin allowlist Writes from a domain you haven't listed are rejected. Reads aren't — public counts are public.
Rate limits Per site + IP. Beacons 120/min, writes 10/min, sign-in requests 3/min.
Bot filtering Crawlers, prefetchers and headless browsers are answered normally and counted not at all.
Honeypot A hidden field a real visitor never fills.
Turnstile Optional per site. When on, an unverifiable token is a rejection.
Spam screening Link thresholds, banned words, blocked domains, and AI classification.

Someone determined can still send you junk from a script. That's what the moderation queue is for — the goal here is that they can't do it cheaply, and can't do it from someone else's website using your visitors.

Reading

GET /:site/summary?t=post:a,post:b

Counters for up to 50 targets at once.

{ "items": { "post:a": {
  "views": 1240, "reads": 480,
  "rating": { "avg": 4.5, "count": 12, "histogram": { "5": 8, "4": 4 } },
  "reactions": { "like": 37 }, "comments": 9, "commentsOpen": true
} } }

views is absent — not 0 — when you've hidden view counts or the number is below your display floor. Same for rating: null. Don't treat a missing field as zero; it means "not for public consumption", which is a different thing.

Sent with Cache-Control: public, max-age=30, stale-while-revalidate=120, which your visitors' browsers honour — a reader flipping between two posts doesn't refetch. There is no shared edge cache in front of it today.

GET /:site/comments?t=post:a&limit=50

Published comments only, one level of replies, oldest first.

{ "items": [ { "id": "cmt_1", "authorName": "Alice", "authorKind": "guest",
  "body": "Great post", "createdAt": "2026-09-01T10:00:00Z", "replies": [] } ] }

authorKind is guest, member or owner. Email addresses are never in a public response.

GET /:site/popular?range=7d&limit=10

Most-viewed targets with titles attached, so a "trending" widget needs no second call. Windows: 7, 30 or 90 days.

GET /:site/live?t=post:a

Concurrent readers per target, over a five-minute window. Answers zeros rather than an error whenever it can't tell — a live counter is decoration.

GET /:site/config

Your site's public flags: which reactions are on, whether ratings are, your Turnstile key, and the comment mode. The SDK reads this so it knows what to render.

Writing

POST /:site/beacon

{ "t": "post:abc", "e": "view", "p": "/blog/my-post", "r": "https://news.ycombinator.com/", "d": 0.8 }

e is view, read or share. d is scroll depth 0–1. Send it as text/plain — that's what navigator.sendBeacon uses, and it avoids a CORS preflight.

Always answers 204, whatever happened. Unknown site, bad origin, rate limited, bot, malformed — all 204. A beacon is fire-and-forget, and a status code nobody reads is only useful to someone probing.

POST /:site/reactions

{ "t": "post:abc", "vid": "your-visitor-id", "kind": "like", "value": 1 }

value: 0 removes the vote. For kind: "rating", value is 1–5. vid is a stable id you generate and keep in localStorage — it's how a visitor's second click resolves against their first.

→ { "data": { "kind": "like", "value": 1, "created": true } }

POST /:site/comments

{ "t": "post:abc", "name": "Alice", "email": "alice@example.com",
  "body": "Great post", "website": "" }

website is the honeypot — a hidden field. Send whatever the field holds, including empty. Don't filter it out client-side: the server decides what a filled honeypot means, and stripping it removes the trap.

→ { "data": { "id": "cmt_1", "status": "published", "editToken": "…" } }

status is only ever published or pending. A comment caught as spam reports pending too — deliberately, so a spammer can't use your responses to tune their payload.

editToken is good for five minutes and lets the poster fix one typo via PATCH /:site/comments/:id. The edited text is re-screened, so it isn't a way around the filters.

POST /:site/comments/:id/flag

{ "reason": "spam" }, all fields optional. Flagged comments surface in your inbox.

Members

POST /:site/members/verify-request mail a sign-in link
GET /:site/members/verify?token=… redeem it (the link itself)
POST /:site/members/me who is this session?
POST /:site/members/logout sign out everywhere

verify-request returns the same 200 for a new address, an existing member, a throttled one and a banned one. Anything else would let a stranger test whether an address has commented on your blog.

The redeem step puts the session in the URL fragment (#vlz_session=…), never the query string — a fragment never reaches a server, a log, or a Referer header. The SDK picks it up and cleans the address bar.

Errors

Code
403 origin_not_allowed your domain isn't on the site's allowlist
429 rate_limited back off
413 payload_too_large 512 B for beacons and reactions, 8 KB for comments
403 comments_disabled / comments_closed off for the site, or for that target
401 membership_required the site needs a verified reader
400 captcha_failed Turnstile rejected the token
402 the workspace can't currently accept comments (billing)
404 target_not_found the post or entry doesn't exist or isn't published

The 402 message shown to a visitor is deliberately vague. Your billing state isn't a passing reader's business; the error code still tells your own tooling which case it was.

Engagement · API referenceEdit on GitHub