Server API

Send events and identify people from your backend; read any report.

Authenticate with an API key as a bearer token. Read keys can call the reports; write keys can send events; full keys do both. If a key reaches more than one site, pass site_id.

Send events

curl https://pathrail.io/api/v1/events \
  -H "Authorization: Bearer sk_pr_..." \
  -H "Content-Type: application/json" \
  -d '{"events":[{"name":"signup","email":"ada@example.com","props":{"plan":"pro"}}]}'
nameRequired. The event name, like signup.
email, user_idWho did it. Joins the event to their visits.
visitor_idwindow.pathrail.visitorId from the browser, if your backend has it.
propsA flat object of strings, numbers and booleans.
revenue_cents, currencyFor a purchase outside the three connected providers.
path, tsOptional page and time (defaults to now).

Up to 1,000 events per request.

Identify

curl https://pathrail.io/api/v1/identify \
  -H "Authorization: Bearer sk_pr_..." \
  -H "Content-Type: application/json" \
  -d '{"visitor_id":"v_...","email":"ada@example.com","user_id":"42"}'

Annotations

curl https://pathrail.io/api/v1/annotations \
  -H "Authorization: Bearer sk_pr_..." \
  -H "Content-Type: application/json" \
  -d '{"text":"Deployed v2.3","date":"2026-10-21"}'

Marks a deploy, launch or price change on the charts. date defaults to today. A metric alert lists notes dated near the start of a drop under What to check. Needs a write or full key.

Read reports

curl "https://pathrail.io/api/v1/stats/breakdown?dimension=channel&period=30d" -H "Authorization: Bearer sk_pr_..."

Reports: overview, timeseries, breakdown, realtime, goals, funnels, revenue, customers, ltv, retention, ai, ai_uncrawled, ai_confidence, ai_answers, survey, bots, bot_signups, apps, predictions. Ranges: period (today, 7d, 30d, and so on) or from and to. Filters: filters as JSON, like {"channel":"AI","country":"!US"}. GET /api/v1/sites lists the sites a key reaches.

NextMCP server and Ask
Server API · Pathrail docs