XTRACKER

API reference

Every XTRACKER ingress endpoint in one place: POST /events, /bind, /clicks and GET /e, /bind — auth, parameters, and responses.

The complete ingress surface. Base URL: https://xtracker.cc.

Authentication

Two credentials, both per-space, from the API keys page:

  • BearerAuthorization: Bearer <secret> for all POST endpoints. Server-side only.
  • Ingest token?token=<secret> for header-less GET endpoints (postbacks).

Rotation keeps the previous secret valid for 24h so you can swap without downtime.

Where to find and rotate your keys

POST /events

Record a canonical event.

Body (JSON):

Field Type Notes
event string, required contact / subscribed / registration / deposit
uid string the click id; optional but recommended
value string/number deposit amount
currency string defaults to USD
eid string external id for time-independent dedup
occurred_at_ms int epoch ms; defaults to receive time
curl -X POST https://xtracker.cc/events \
  -H "Authorization: Bearer <BEARER>" -H "Content-Type: application/json" \
  -d '{"uid":"abc","event":"deposit","value":"25.00","currency":"USD","eid":"tx-1"}'

Response: {"ok": true, "status": "queued" | "duplicate", "inbox_id": "…"}

POST /bind

Bind a click uid to a Telegram user id (compare-and-set; safe to retry).

curl -X POST https://xtracker.cc/bind \
  -H "Authorization: Bearer <BEARER>" -H "Content-Type: application/json" \
  -d '{"uid":"abc","tg_id":555123}'

Response: {"ok": true, "matched": true}matched is true when a click with that uid exists in the space.

POST /clicks

Back-fill a click and get a uid (only when the click didn't come from the tracker's own landing).

Body: link_slug, fbclid, campaign_name, raw_query (all optional).

Response: {"uid": "…"}

GET /e

Header-less event ingest — for postbacks. Same effect as POST /events.

Query: token (required), event (required), uid, value, currency, eid, t (epoch ms, optional → receive time).

https://xtracker.cc/e?token=<INGEST_TOKEN>&event=deposit&uid=abc&value=25&currency=USD&eid=tx-1

Response: {"ok": true, "status": "queued" | "duplicate"} (or invalid_event / invalid_value / invalid_time).

GET /bind

Header-less bind.

https://xtracker.cc/bind?token=<INGEST_TOKEN>&uid=abc&tg=555123

Response: {"ok": true, "matched": true}

Status values

Status Meaning
queued accepted, new
duplicate deduped — also a success
invalid_event not one of the four canonicals
invalid_value value wasn't numeric
invalid_time supplied t implausible

Next