Clicks and impressions
Read click and impression data, or record them from your server.
List clicks
GET /api/v1/clicks| Parameter | Description |
|---|---|
campaign_id | Only this campaign |
affiliate_id | Only this publisher |
advertiser_id | Only this advertiser |
status | tracked or rejected (blocked by fraud rules) |
country | Two-letter country code, e.g. IN |
device, os | e.g. mobile, android |
click_id | Find one click |
from, to | Date range, YYYY-MM-DD |
limit, page, offset | Pagination |
curl "https://app.affilinext.com/api/v1/clicks?campaign_id=cmp_123&from=2026-10-01&to=2026-10-07" \
-H "Authorization: Bearer ak_your_key"Each click includes id (the click ID), campaignId, affiliateId, status, country, device, os, browser, sub (your sub IDs), fraud and createdAt.
Record a click from your server
Normal traffic goes through your tracking link, which records the click and redirects the visitor. Use this endpoint when you need the click ID without a redirect — for example in an app or a server-side flow.
POST /api/v1/clicks
Content-Type: application/json{
"campaign_id": "cmp_123",
"affiliate_id": "aff_102",
"sub1": "facebook",
"sub2": "retargeting-a",
"country": "IN",
"device": "mobile",
"os": "android"
}Response 201:
{
"success": true,
"click": { "id": "clk_9e1f...", "campaignId": "cmp_123", "status": "tracked" },
"redirectUrl": "https://advertiser.example.com/offer?aff_click_id=clk_9e1f..."
}Send the visitor to redirectUrl, or pass click.id to the advertiser yourself.
With a publisher key, clicks are always recorded as your own account — you can leave out affiliate_id. With an advertiser key, you can only record clicks on your own campaigns.
| Error | Reason |
|---|---|
400 | Unknown campaign_id or affiliate_id |
403 | Campaign paused or pending, publisher not approved for it, traffic outside its targeting, or the key belongs to a different account |
429 | The campaign's cap has been reached |
Impressions
GET /api/v1/impressions takes the same filters as clicks.
POST /api/v1/impressions records an impression. Send campaign_id and affiliate_id, plus optional device and os.