Clicks

Record a click

Server-side tracking: the same resolution rail.js uses (handle first, then custom link values). An unknown value is a 404, not a silent drop. The same visitor_token across clicks joins one referral.

Scope: commissions:write (or write)

post/v1/clicks

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/clicks
  • Auth: HTTP bearer

Request body

program_idstring required

Prefixed id (prg_…)

valuestring required

The partner handle or link value the visitor arrived with

paramstring
landing_urlstring uri required
visitor_tokenstring required

Your stable identifier for this visitor; the same token across clicks makes one referral

referrerstring
ipstring

Hashed on write, never stored

user_agentstring
countrystring
devicestring

Example request

{
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK"
}

Response

The click, attached to its referral

idstring required

Prefixed id (clk_…)

object'click' required
program_idstring required

Prefixed id (prg_…)

partner_idstring required

Prefixed id (part_…)

link_idstring nullable required

Prefixed id (lnk_…)

referral_idstring nullable required

Prefixed id (ref_…)

user_agentstring nullable required
refererstring nullable required
countrystring nullable required
devicestring nullable required
landing_urlstring nullable required
created_atstring date-time required

ISO-8601, UTC

Example response

{
  "id": "clk_7uSyy9FqVLCFWrdPeZaK",
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "link_id": "lnk_7uSyy9FqVLCFWrdPeZaK",
  "referral_id": "ref_7uSyy9FqVLCFWrdPeZaK",
  "created_at": "2026-08-21T10:15:30.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.