API
Let your club website make a fresh link for every announcement it sends, and credit the bookings that follow. Keys are made under Settings in your account.
Every request carries Authorization: Bearer sck_yourclub_…. JSON in and out. Errors come back as { "error": "…" }. 120 requests a minute per key.
| Method | Path | Body | Does |
|---|---|---|---|
| GET | https://squash.click/api/me | Your club and key. | |
| POST | https://squash.click/api/links | destination, label, campaign?, code?, channel?, check_mode?, expires_in?, max_clicks?, sent_at? | Mint a link. Returns the short url. code asks for a hand-picked name; channel is whatsapp, email, poster and so on; check_mode is off, quiet or ask; expires_in is seconds; max_clicks counts people only; sent_at (unix seconds) is when the message went out, used for time-to-click. |
| GET | https://squash.click/api/links?campaign= | Your links with stats. | |
| GET | https://squash.click/api/links/{code}/stats | Per-day clicks, devices, browsers, countries, referrers, actions. | |
| PATCH | https://squash.click/api/links/{code} | destination?, label?, campaign?, active?, channel?, check_mode?, expires_at?, max_clicks? | Repoint, relabel, switch off, or change the options. |
| GET | https://squash.click/api/dashboard?weeks=12 | Everything on the Dashboard page as JSON: weekly clicks by channel, channel and campaign tables, click-time heat map, time-to-click curves, funnel, dead links. | |
| GET | https://squash.click/api/export.csv | All your links with their numbers, as CSV. | |
| POST | https://squash.click/api/conversions | code, kind, ref? | Credit a booking or sign-up to a code. ref is your own id; it is hashed and stops double counting. |
How a club site uses it
- When building an announcement, POST /links with the page it points at and a label. Put the returned url in the message.
- Visitors arrive on your page with ?s=<code>. Keep the code; a cookie on your own domain is enough.
- When a visitor books or registers, POST /conversions with the code, a kind such as booking, and your booking id as ref.
- Optional, for the full funnel: put <img src="https://squash.click/px/<code>.gif" alt="" width="1" height="1"> on the landing page when ?s= is present. That counts "arrived on the page", once per visitor, so you can see clicks that never loaded your site.
Sensitive links: passthrough
Never put a password-reset or login token in a short link's destination. Put it in the URL fragment instead: https://squash.click/<code>#t=TOKEN. Browsers never send the fragment to squash.click, and they carry it across the redirect, so your page receives it in location.hash. squash.click records the click and holds only the public destination. Use check_mode: "ask" and max_clicks: 1 for links like that.
curl -X POST https://squash.click/api/links \
-H "Authorization: Bearer $KEY" -H "content-type: application/json" \
-d '{"destination":"https://examplesquash.org/monday","label":"Monday social, WhatsApp, 6 Oct","campaign":"monday-social"}'