Report a conversion
Changed onReport a conversion — a purchase, signup, or custom event that happened on your site after someone clicked a Linkly link.
Pass the linkly_cid your landing page captured to attribute the conversion to the originating link. A conversion that cannot be attributed — no linkly_cid, an unrecognised one, and no earlier attributed event for the same external_id — is discarded: the call returns 202 with attributed: false and nothing is stored. It is not an error, so do not retry it; check that your landing page is capturing and forwarding linkly_cid.
Leads and sales
Set event_type to lead for signups, trials and demo requests, sale when money changes hands, or custom for anything else. The type drives the clicks → leads → sales funnel.
Send external_id — your own customer identifier — on every event. A lead reported with both an linkly_cid and an external_id ties that customer to the link, and later events for the same external_id inherit the attribution automatically. This is what makes server-side sales attributable: the purchase usually arrives from a billing webhook that never saw the linkly_cid. Attribution is first-touch, so a customer who later arrives via a different link keeps the credit on their original one.
Supply event_id to make the call idempotent. Reporting the same event_id twice returns 200 with the original conversion instead of creating a duplicate, so a retrying client is safe.
Request
- Base URLhttps://api.linklyhq.com
- AuthAPI key in query parameter api_key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
The ID of the workspace. Required when authenticating with an API key. Omit it with an OAuth token, which is bound to one workspace.
Request body
Example request
{
"amount_cents": 4999,
"country": "US",
"currency": "USD",
"event_id": "shopify-1234",
"event_name": "purchase",
"event_type": "sale",
"external_id": "customer-42",
"linkly_cid": "2on1Y.01KYPGEEPJSPR3S564QRBDGA1W",
"metadata": {
"sku": "ABC-123"
},
"occurred_at": "2026-07-29T10:30:00Z",
"visitor_ip": "203.0.113.42"
}Response
Already recorded — the existing conversion for this event_id
Example response
{
"amount_cents": 4999,
"click_id": "01KYPGEEPJSPR3S564QRBDGA1W",
"country": "US",
"currency": "USD",
"event_id": "shopify-1234",
"event_name": "purchase",
"event_type": "sale",
"external_id": "customer-42",
"id": "01KYPH20SEJY4HQSCPMWW60QE0",
"inserted_at": "2026-07-29T10:30:01",
"ip_source": "visitor",
"link_id": 41657524,
"occurred_at": "2026-07-29T10:30:00.123456Z",
"source": "api"
}Changes
- breaking
the
response's property format changed fromdate-timeto no format for status - breaking
the
response's property format changed fromdate-timeto no format for status - info
added the new optional
queryrequest parameterworkspace_id - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
the response property
became required for the status - info
added the success response with the status
- breaking