Analytics
BASE https://api.rii.link/v1AUTH: BEARER → AUTHENTICATION
Pull aggregates on demand, or hold an SSE stream open and get every click as it happens.
GET
/v1/links/{id}/statsLink stats
One aggregate call, bucketed how you ask. History depth follows the plan — a year on the entry paid tier.
PARAMETERS
from / totimestampBounds of the window. Default: last 30 days.
group_bystringcountry, device, referrer, or rule.
intervalstringhour or day — buckets the series for charting.
REQUEST
curl "https://api.rii.link/v1/links/lnk_8h2f0q/stats?group_by=country" \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 200
{
"total": 1284,
"group_by": "country",
"buckets": [
{ "key": "DE", "clicks": 512 },
{ "key": "US", "clicks": 401 },
{ "key": "FR", "clicks": 371 }
],
"from": "2026-07-13T00:00:00Z",
"to": "2026-08-12T00:00:00Z"
}
GET
/v1/events/streamThe click stream (SSE)
Server-sent events over plain HTTP — the live surface that exists today, no webhook registration required. Hold it open with -N; every click on the workspace arrives as one frame.
PUSH-SHAPED AND REAL — OUTBOUND WEBHOOK DELIVERY IS ROADMAP (Q1 ’27)
REQUEST
curl -N https://api.rii.link/v1/events/stream \
-H "Authorization: Bearer $RII_KEY" \
-H "Accept: text/event-stream"
STREAM · TEXT/EVENT-STREAM
event: click
data: {"link_id":"lnk_8h2f0q","country":"DE","device":"ios","rule_matched":"country=DE"}
event: click
data: {"link_id":"lnk_2xw11p","country":"US","device":"desktop","rule_matched":null}