Developers

Kollab API

Everything a brand needs to track clicks and report conversions back to Kollab. All endpoints live under https://www.trykollab.com/api/public, accept and return JSON, and allow cross-origin requests.

Overview

The flow has three steps:

  1. A partner shares their tracking link. A visitor clicks it.
  2. Kollab records the click, sets a first-party attribution cookie and redirects to your landing page with ref and kid parameters.
  3. When the visitor converts (lead, sale, booked call…), you tell Kollab — from your server or with the pixel. Kollab credits the partner and creates a pending commission.

Your per-campaign snippets with real IDs are in the dashboard under Admin → Tracking.

GET https://www.trykollab.com/api/public/track/{tracking_code}

Each approved partner gets a unique tracking_code per campaign. The link only works once an admin approves the partner and the campaign is active.

On success Kollab responds 302 to your destination URL with two parameters added:

https://yourbrand.com/landing?ref={tracking_code}&kid={click_id}

Store kid (click ID) with the visitor's session or order — it's the most reliable way to attribute the conversion later.

Record a conversion (server-to-server)

POST https://www.trykollab.com/api/public/convert
Content-Type: application/json
FieldTypeNotes
click_iduuidThe kid value from the landing URL. Preferred.
tracking_codestringFallback — attributes to the code's most recent click.
campaign_iduuidEnables cookie attribution when called from the browser.
order_valuenumberSale amount. Required for Rev Share payouts.
currencystring(3)e.g. USD. Defaults to the campaign currency.
external_refstringYour order or lead ID, for reconciliation.

At least one of click_id, tracking_code, or campaign_id + attribution cookie is required.

curl -X POST https://www.trykollab.com/api/public/convert \
  -H "Content-Type: application/json" \
  -d '{
    "click_id": "8d1c2f7e-1b2a-4c3d-9e8f-0a1b2c3d4e5f",
    "order_value": 149.00,
    "currency": "USD",
    "external_ref": "ORDER-10045"
  }'

Response:

{
  "ok": true,
  "conversion_id": "c7a1…",
  "fraud_score": 0,
  "flagged": false,
  "commission_amount": 29.80
}

Browser pixel

Drop this on your thank-you page. It sends the stored click ID (or the attribution cookie) to Kollab.

<script>
  (function () {
    var p = new URLSearchParams(location.search);
    var kid = p.get("kid") || localStorage.getItem("kollab_kid");
    fetch("https://www.trykollab.com/api/public/convert", {
      method: "POST",
      credentials: "include",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        click_id: kid || undefined,
        campaign_id: "YOUR_CAMPAIGN_ID",
        order_value: 0,
        external_ref: "ORDER_OR_LEAD_ID"
      })
    });
  })();
</script>

On your landing page, save the click ID so it survives navigation:

<script>
  var kid = new URLSearchParams(location.search).get("kid");
  if (kid) localStorage.setItem("kollab_kid", kid);
</script>

Attribution rules

  • Last click wins. The attribution window defaults to 30 days and is set per campaign.
  • Conversions after the window return 410 and are not credited.
  • Every conversion is fraud-scored automatically; suspicious ones are flagged for admin review.

Commissions

Each conversion creates a pending commission based on the campaign's model:

  • CPL / CPA / CPS / Booked call — the campaign's fixed payout per acquisition.
  • Rev Share — payout % × order_value.

Admins approve or reject commissions in the review queue before payout.

Errors

400Invalid JSON or invalid fields (details included).
404Unknown click, inactive link, or campaign not available.
410Attribution window expired.
422No attribution found — send click_id, tracking_code or the cookie.
500Server error — safe to retry with the same external_ref.

Health check

GET https://www.trykollab.com/api/public/health

{ "status": "operational", "components": { "api": "operational", "database": "operational" } }

See live results on the status page. Questions? Email hello@trykollab.com.