offerswap.com API

Branded short links, campaign tracking and click and page view analytics.

API https://app.offerswap.com Links https://offerswap.com/{code} Auth Bearer bgl_... 93 endpoints

The OfferSwap API does everything the app does: short links and their stats, collections, custom domains, tracking pixels, and the campaign tracker (campaigns, offers, landers, traffic sources, postbacks, reports and site properties). Responses are JSON over HTTPS.

OfferSwap was called BuyGoLinks until 2026-11-20. Every buygolinks.com link, campaign link, /click button, t.js tag and postback URL, and every call to https://app.buygolinks.com/api/*, keeps working unchanged.

Base URLs

Authentication

Every /api/* endpoint needs Authorization: Bearer <token>. Two token shapes work:

  1. Personal access token, bgl_<24 base62>. Use this for anything programmatic. Create one with POST /api/api-keys or in the app under Account Settings, API keys. The raw token is returned exactly once; only its SHA-256 is stored.
  2. Supabase JWT, issued to the app after sign in. Short lived, not meant for integrations.

Errors

Errors are JSON shaped { "error": "<code>" }, and many also carry a human message. Common codes: unauthorized (401), forbidden (403, it exists but is not yours), not_found (404), bad_json, invalid_url, no_changes and name_required (400), and alias_taken, slug_taken and name_taken (409). Each endpoint lists its own below.

Postbacks

Every account has one postback URL, returned as postback_url on GET /api/me. It matches the sale to the click by clickid alone and credits whichever campaign the click belongs to, so one URL serves every campaign and every network. event= says what happened: none is a sale, refund and chargeback are built in, and anything else is a custom event from /api/custom-events. See the Postback URL under Public endpoints for every parameter.

Time zones

Reports count days, weekdays and hours in the account's time zone (timezone on GET /api/me, set with PATCH /api/me). The report endpoints take ?tz= to override it for one call and echo the zone they used.

Versioning

The API is unversioned. Breaking changes are avoided, and additions (new fields, new endpoints) ship without notice. This spec is the contract.

Quickstart

# Create a personal access token (Account Settings, API keys), then:
TOKEN="bgl_..."

# Your account, including your postback URL
curl -H "Authorization: Bearer $TOKEN" https://app.offerswap.com/api/me

# Create a short link
curl -X POST https://app.offerswap.com/api/links \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"destination_url":"https://www.amazon.com/dp/B08N5WRWNW?tag=yourtag-20"}'

# Today's campaign numbers, counted in your time zone
curl -H "Authorization: Bearer $TOKEN" \
  "https://app.offerswap.com/api/tracker/overview?days=1"

For AI agents

Everything here is built to be read by software as well as people.

MCP server

npx -y @offerswap/mcp with OFFERSWAP_API_KEY set. Works with Claude, Cursor, Cline, Continue, Hermes and any MCP client, and covers every endpoint on this page.

@offerswap/mcp on npm

OpenAPI 3.1

The spec this page is generated from. Import it into Postman, a Custom GPT's actions or any OpenAPI tool.

/openapi.yaml

llms.txt

The index file. Fetch this first if you are an LLM finding your way around.

/llms.txt

llms-full.txt

Every endpoint in one markdown file, for a single fetch.

/llms-full.txt

Account

The signed-in account's profile, plan usage, preferences and postback URL.

GET/api/me#

Current user profile

Profile of the signed-in user: plan, billing_period, current_period_end (next billing date), cancels_at (when a cancelled subscription ends, otherwise null), click + page-view usage meters (pageview_usage), preferences (tracker_range_days, timezone: the IANA zone reports count days and hours in, or null), and postback_url, the account's postback URL (the only one) (https://offerswap.com/postback/u/{token}), one URL that records a conversion for any click across every campaign and network.

Responses

StatusMeaning
200

OK

PATCH/api/me#

Update your preferences

tracker_range_days (1, 7, 14, 30 or 90) is the dashboard's default range. timezone is the IANA zone (e.g. America/New_York) that reports count days, weekdays and hours in, on every device and for API calls with no tz. null clears it. An unknown name is a 400 invalid_timezone.

Request body

FieldTypeNotes
tracker_range_daysinteger

One of 1, 7, 14, 30, 90.

timezonestring | null

Example America/New_York.

Responses

StatusMeaning
200

OK

400

invalid_range / invalid_timezone / no_fields

Statistics

Click analytics for short links. Campaign traffic and page views are under Reports.

GET/api/stats/overview#

Account-wide aggregated LINK CLICK stats

Account-wide analytics for branded short LINKS only (total clicks, by day/country/device/browser/referrer, peak hour & weekday). Does NOT include Tracker page views, site-property traffic, or campaign visits/conversions. For PAGE VIEWS use GET /api/tracker/overview or the per-property GET /api/properties/{id}/stats. To report clicks AND page views together, read both this endpoint and GET /api/tracker/overview and combine them, because they are separate event streams.

Parameters

NameIn / typeNotes
daysquery integer

Time window in days. Clamped to 1–90. Default 14.

Responses

StatusMeaning
200

Account-wide click stats in one round trip (short-link clicks only; page views and campaign traffic are under Reports). Returns StatsOverview.

401

Missing or invalid bearer token.

Collections

Folders of links. A collection can also be a rotator, offerswap.com/c/{alias}, which sends each visit to a random member.

GET/api/collections#

List collections

Responses

StatusMeaning
200

Collections with link + click counts.

POST/api/collections#

Create a collection

Request body

FieldTypeNotes
name requiredstring

Max 80 chars.

descriptionstring

Max 280 chars.

colorstring

Hex color from a fixed palette; invalid values fall back to #ef4444. Example #3b82f6.

starredboolean

Default false.

rotator_enabledboolean

Default false.

rotator_aliasstring

8–24 chars [A-Za-z0-9_-]. Auto-generated if omitted while rotator_enabled is true.

Responses

StatusMeaning
200

Created.

400

name_required or bad_json.

409

alias_taken: could not allocate a unique rotator alias after 5 attempts.

GET/api/collections/{id}#

Collection detail (meta + member links + aggregated stats)

Parameters

NameIn / typeNotes
id requiredpath integer
daysquery integer

Default 14.

Responses

StatusMeaning
200

Collection detail page payload.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

PATCH/api/collections/{id}#

Update a collection

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
namestring

Max 80 chars.

descriptionstring

Max 280 chars.

colorstring
starredboolean
rotator_enabledboolean
rotator_aliasstring

Responses

StatusMeaning
200

Updated.

400

invalid_alias or no_changes.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

409

alias_taken.

DELETE/api/collections/{id}#

Delete a collection (member links are detached, not deleted)

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Deleted.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

Tracking pixels

Meta, TikTok and Google pixels. They fire in the browser when a short link is clicked, and a Meta or TikTok pixel with a Conversions API token also receives a campaign's sales server to server.

GET/api/tracking-pixels#

List tracking pixels + supported platforms

Responses

StatusMeaning
200

Pixels + platform catalog (label/placeholder/help text).

POST/api/tracking-pixels#

Add a tracking pixel

Request body

FieldTypeNotes
platform requiredstring

One of the keys returned by GET /api/tracking-pixels under platforms.

pixel_id requiredstring
labelstring

Max 80 chars.

default_eventstring

Event this pixel fires by default (e.g. Facebook Purchase, TikTok CompletePayment). Must be a valid event for the platform. See platforms[platform].events. Defaults to the platform default.

capi_tokenstring

Optional server-side Conversions API access token (Facebook/TikTok). Lets campaign events fire server-to-server. Whitespace inside it (a line break from pasting) is removed. Never returned; only has_capi_token and capi_token_tail (its last four characters) are.

test_event_codestring

Optional Meta test event code. While set, every server event this pixel sends lands in Test events and never counts.

activeboolean

Default true.

Responses

StatusMeaning
200

{ pixel, meta_check }. For a Facebook pixel saved with a token, meta_check is { ok, name, error }: Meta's answer to an empty event batch sent with that token, which it refuses as empty only when the token can send to that dataset, so nothing is recorded and a wrong id (such as the Owner number) or token comes back ok: false with Meta's message. name is the dataset's name when the token can read it, which a Conversions API token usually cannot. Null when there was nothing to check.

400

invalid_platform, invalid_pixel_id or invalid_capi_token.

POST/api/tracking-pixels/{id}/test#

Send one test event with the pixel's token

Sends a $1 Purchase (or the event in the body) server-side with the pixel's own token, to prove the pixel id and token work. Requires a test_event_code on the pixel, so a test never counts as a real sale. The result is recorded on the pixel's last_sent_* / last_error*.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
eventstring

Optional event name valid for the platform. Defaults to Purchase.

Responses

StatusMeaning
200

{ ok, event, error, test_event_code }. ok is false with error when the platform refused.

400

no_capi_token, no_test_event_code or unsupported_platform.

404

Resource does not exist.

PATCH/api/tracking-pixels/{id}#

Update a pixel

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
pixel_idstring
labelstring
default_eventstring

New default event (must be valid for the pixel's platform).

capi_tokenstring | null

New Conversions API token, or empty string / null to clear.

test_event_codestring | null

Meta test event code, or empty string / null to clear it and go live.

activeboolean

Responses

StatusMeaning
200

{ pixel, meta_check }. meta_check is set when pixel_id or a new capi_token was saved on a Facebook pixel, as on create; null otherwise.

400

invalid_pixel_id, invalid_capi_token or no_changes.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

DELETE/api/tracking-pixels/{id}#

Delete a pixel

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Deleted.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

Domains

Serve short links and campaigns from your own hostname, such as go.acme.com, with SSL from Cloudflare for SaaS. Paid plans only.

GET/api/domains#

List custom domains

List the user's branded short-link domains, plan tier, plan domain limit, and the CNAME target each domain must point at.

Responses

StatusMeaning
200

OK

POST/api/domains#

Register a custom domain

Creates a Cloudflare for SaaS custom hostname and stores it. The user must then point a CNAME record at cname_target for SSL/validation to complete. Free plan returns 402 upgrade_required.

Request body

FieldTypeNotes
hostname requiredstring

Example go.acme.com.

Responses

StatusMeaning
200

Created.

400

invalid_hostname or reserved_hostname

402

upgrade_required or plan_limit_reached

409

hostname_taken

502

cloudflare_error

DELETE/api/domains/{id}#

Remove a custom domain

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Removed.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

POST/api/domains/{id}/verify#

Force re-check domain status against Cloudflare

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Refreshed.

GET/api/domains/{id}/dns#

Detect the DNS host and the easiest way to connect

Reads the domain's public nameservers. one_click.method is domain_connect (send the user to one_click.url), cloudflare_oauth (the user clicks Connect Cloudflare in Properties, which needs a browser), or null (add the CNAME by hand). On Cloudflare, one_click.token_url is also set, for connect-cloudflare.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Detection result.

POST/api/domains/{id}/connect-cloudflare#

Add the CNAME to the user's own Cloudflare zone

For callers with no browser. Uses a Cloudflare API token with Zone Read and DNS Edit for this one request. The token is never stored. Never overwrites an existing record.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
api_token requiredstring

Responses

StatusMeaning
200

Record created, or already correct.

400

invalid_token

403

token_missing_dns

404

zone_not_found

409

record_exists: a different record is on this hostname.

API keys

Personal access tokens for the API and the MCP server.

GET/api/api-keys#

List your personal access tokens (token hash never returned)

Responses

StatusMeaning
200

Tokens with metadata.

POST/api/api-keys#

Create a new personal access token

Returns the raw token exactly once. Store it immediately. There is no way to retrieve it again. We store SHA-256(token) only.

Request body

FieldTypeNotes
labelstring

Default "Untitled key". Max 80 chars.

Responses

StatusMeaning
200

Created. Token shown ONCE.

DELETE/api/api-keys/{id}#

Revoke an API key

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Revoked.

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

Campaigns

A campaign is the tracked link that goes in an ad. Its flow routes each visit to landing pages and offers by weight, mints a click id, and credits sales from the postback to the ad that sent them.

GET/api/campaigns#

List campaigns with quick-look stats

Responses

StatusMeaning
200

OK

POST/api/campaigns#

Create a campaign

Server mints an 8-char base62 code (same namespace as link codes; a DB trigger blocks collisions). Pass optional offer_ids and lander_ids arrays (with matching *_weights) to wire the destination inline.

Every campaign response includes a click_url (https://{host}/click): the single, campaign-agnostic lander click URL the operator pastes into their lander's CTA button. It's the same on every campaign, so one lander can be reused across many; the campaign is resolved at click time from the bgl_clk_{code} cookie (short-link traffic) or the ad's ?utm_campaign={slug} (matched against any of the campaign's direct_slugs) forwarded onto the CTA (direct-link). It always resolves to an offer (chosen by the flow graph + split weights), never a lander, never a dead page (see the public /click path). Responses include direct_slugs: [{ slug, label }] plus a legacy direct_slug that mirrors the OLDEST slug for back-compat.

Request body

FieldTypeNotes
name requiredstring
traffic_source_idinteger | null

Id of one of the caller's saved traffic sources (from GET /api/traffic-sources). One per campaign; mirrors the source's name into the display label.

traffic_sourcestring

Legacy structured traffic source key (facebook, google, tiktok, …). Prefer traffic_source_id.

traffic_source_labelstring

Free-text display label.

countrystring
cost_modelstring

One of not_tracked, cpc, cpm. Default "not_tracked".

cost_valuenumber
transition_modestring

How the campaign link sends a visitor on. 302 is an instant redirect. meta_refresh serves a short Redirecting page that forwards at once, so the next page sees the campaign link, not the landing page, as the referrer. Neither fires a pixel. One of 302, meta_refresh. Default "302".

domain_idinteger | null

Optional id of one of the caller's active custom domains (from /api/domains). The campaign's short link will resolve at that hostname. If omitted, defaults to the caller's first active custom domain, or offerswap.com if they have none. Pass null to force the platform default.

conversion_pixel_idinteger | null

Optional id of one of the caller's tracking pixels to fire when this campaign converts (server-side via the pixel's CAPI token when set). Pass null for none.

conversion_eventstring

Event a sale fires (e.g. Purchase, Lead, CompletePayment). Must be valid for the pixel's platform; defaults to that pixel's default_event. Prefer pixel_events.

pixel_eventsobject | null

Which of the campaign's events reach its conversion pixel, and as what. Keys are conversion (a sale), a traffic event (lander_view: the campaign's landing page shown, or a view of a direct lander from the property tag; visit: the ad click reaching the campaign link; offer_click: the tap that leaves for the offer) or one of the caller's custom event slugs; values are { event, first_only? }. Bot traffic is never sent. A missing key is not sent; first_only sends only the click's first event of that kind. Refunds and re-fired orders are never sent, and each event gets its own event_id. Null keeps the old rule (sales only, as conversion_event). 400 invalid_pixel_event_key / invalid_pixel_event on a bad key or an event name the pixel's platform does not take.

report_value_modestring

What revenue value to report back to the ad platform on a CAPI conversion. payout (default) = real payout; fixed = always report_value_fixed; adjusted = real payout − report_value_adjust_pct% − report_value_adjust_flat (floored at 0). Lets the operator withhold their margin from what the platform optimizes against. One of payout, fixed, adjusted.

report_value_fixednumber | null

Fixed value reported on every conversion when report_value_mode = fixed.

report_value_adjust_pctnumber | null

Percentage subtracted from real payout when report_value_mode = adjusted (applied before the flat amount).

report_value_adjust_flatnumber | null

Flat amount subtracted after the percentage when report_value_mode = adjusted.

direct_slugsarray of string or object

Direct-link tags for this campaign. A campaign can now claim MULTIPLE utm_campaign values, each routing through this campaign's flow. For running traffic STRAIGHT to a lander with no tracker hop: put ?utm_campaign={slug} on the ad URL and the property tag (/t.js) stitches the page view to this campaign. Each item is either a string (used as both slug and label) or an object { slug, label } (slug is the sanitized lowercased-alnum+dashes value matched against incoming utm_campaign; label is the friendly display value, e.g. ABO Testing Campaign). Pass [] to clear all tags. Any slug already used by another of the caller's campaigns returns 409 direct_slug_taken. Use cases: migrating an older campaign onto a new BGL campaign, or turning a lander already receiving direct traffic into a campaign.

direct_slugstring | null

DEPRECATED but still accepted: the legacy single direct-link tag. Prefer direct_slugs. When passed, it's added to the campaign's tag set; in responses direct_slug mirrors the OLDEST slug for back-compat. Returns 409 direct_slug_taken if another campaign already uses it. Pass null to clear (the legacy single field only). Max 80 chars.

fallback_urlstring | null

Optional URL the click falls back to when the flow yields no live offer: the never-dead-end guarantee. If unset, falls back to the platform default. Pass null to clear. Max 2000 chars.

open_in_browserboolean

Older all-offers default, kept for compatibility: sends a phone tap to any offer with no phone_open of its own to Safari or Chrome. Set phone_open on each flow node instead; it wins over this. Default false.

offer_idsarray of integer
offer_weightsarray of integer
lander_idsarray of integer
lander_weightsarray of integer

Responses

StatusMeaning
200

Created

GET/api/campaigns/{id}#

Get a campaign with attached offers and landers

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

PATCH/api/campaigns/{id}#

Update a campaign

Patch any subset of: name, traffic_source_id, traffic_source, traffic_source_label, country, cost_model, cost_value, transition_mode, domain_id, conversion_pixel_id, conversion_event, pixel_events, report_value_mode, report_value_fixed, report_value_adjust_pct, report_value_adjust_flat, direct_slugs, direct_slug (legacy), fallback_url, open_in_browser, dim_labels, archived. Pass dim_labels to replace the names the user gave this campaign's tokens, for example { "utm_medium": "Ad Name" }. Pass direct_slugs (array of strings or { slug, label }) to replace the campaign's full set of direct-link tags ([] clears them); the legacy single direct_slug is still accepted and merged in. Pass domain_id to change the branded hostname the short link resolves under (must be one the caller owns and is active), or null to move it back to offerswap.com. Setting any slug already used by another of the caller's campaigns returns 409 direct_slug_taken.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

Body: object

Responses

StatusMeaning
200

OK

DELETE/api/campaigns/{id}#

Archive a campaign

Campaigns are never deleted. This sets archived_at (the short link stops routing, reports stay) and returns { ok, archived }. PATCH archived=false restores it.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

POST/api/campaigns/{id}/duplicate#

Duplicate a campaign

Deep-copies the campaign's settings, full routing flow graph (nodes + edges with split weights), and derived offer/lander pools into a brand-new campaign with a fresh short code. The copy is named COPY - {original} (or COPY (1) - {original}, COPY (2) - … when duplicating a copy). Stats are not copied and the unique direct-link tags (direct_slugs / legacy direct_slug) are left blank. Returns the new campaign.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

PUT/api/campaigns/{id}/offers#

Replace the campaign's offer split

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
items requiredarray of object

Responses

StatusMeaning
200

OK

PUT/api/campaigns/{id}/landers#

Replace the campaign's lander split

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
items requiredarray of object

Responses

StatusMeaning
200

OK

GET/api/campaigns/{id}/flow#

Get the campaign's routing flow graph (n8n-style)

Returns { flow: { nodes, edges }, offers, landers }. Nodes have kind of source (one entry, ref_id null), lander, or offer. Edges (from_node_id → to_node_id, weight) only go source→lander, source→offer, or lander→offer. The resolver walks this graph per click, so a specific lander can route to its own specific offers. A rule node also carries name, conditions and priority.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

PUT/api/campaigns/{id}/flow#

Replace the campaign's routing flow graph

Replaces the whole graph and re-derives the flat offer/lander pools. tmp_id is any client-stable key; edges reference nodes by tmp_id. Provide exactly one source node. An unwired graph (source with no outbound edges) falls back to flat-pool routing. Set direct: true on a lander the ad links straight to: the campaign link then goes on to its offers instead of sending the visitor to it, and direct landers win over every other edge on the source.

Rules (Voluum style rule paths): a rule node hangs off the source (not on a direct link campaign) or off a lander, with one edge into it. Its own edges are its branches: landers or offers after the source, offers after a lander. At that step, rules are checked in priority order; the first whose conditions all match and that has a branch sends the visitor down its branches, everyone else takes the step's plain edges, and with no plain edge they go to the campaign's fallback_url. Condition types: country, region, city, device (mobile, desktop), os, browser, inapp, language, ip (addresses or CIDR), isp, referrer, param (name plus values), time (from, to, tz) and weekday (values, tz). A bad condition or misplaced rule is 400 with error (invalid_rule, rule_on_direct_source, rule_bad_parent, rule_bad_branch, rule_has_many_parents) and a message.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
nodes requiredarray of object
edges requiredarray of object

Responses

StatusMeaning
200

OK

Offers

The destinations a campaign sends clicks to, usually an affiliate or checkout URL. An offer has no link of its own; the link to share is always a campaign's.

GET/api/offers#

List offers

Parameters

NameIn / typeNotes
include_archivedquery string

1 to include archived offers One of 1.

Responses

StatusMeaning
200

OK

POST/api/offers#

Create an offer

Request body

FieldTypeNotes
name requiredstring
url requiredstring
affiliate_network_idinteger | null
payoutnumber
payout_currencystring

Default "USD".

countrystring

Responses

StatusMeaning
200

Created

POST/api/offers/{id}/campaign#

Create a campaign for an offer (its link to share)

Makes the simplest campaign for the offer (named after it, on the account's default domain, every click to the offer) and returns its link. Each call makes a new campaign.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

{ campaign: { id, name, code, short_url } }

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

PATCH/api/offers/{id}#

Update an offer

Renaming an offer also renames any older short link left on its URL. Offers get no short link of their own.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

Body: object

Responses

StatusMeaning
200

OK

DELETE/api/offers/{id}#

Archive an offer

Offers are never deleted. This sets archived_at and returns { ok, archived }. PATCH archived=false restores it.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

Landers

Landing pages a campaign can send visitors to before the offer.

GET/api/landers#

List landers

Responses

StatusMeaning
200

OK

POST/api/landers#

Create a lander

Request body

FieldTypeNotes
name requiredstring
url requiredstring

Lander URL. May contain {clickid} tokens which the resolver expands at click time.

countrystring

Responses

StatusMeaning
200

Created

PATCH/api/landers/{id}#

Update a lander

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

Body: object

Responses

StatusMeaning
200

OK

DELETE/api/landers/{id}#

Delete a lander

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

Traffic sources

The ad platforms you buy traffic from, with each platform's click macros mapped onto UTM parameters.

GET/api/traffic-sources#

List traffic sources + presets

User-managed list of the platforms the caller buys traffic from. Returns sources plus a presets catalog (Facebook, TikTok, Google, …) with each platform's standard click macros. A campaign references one source via traffic_source_id.

Responses

StatusMeaning
200

OK

POST/api/traffic-sources#

Create a traffic source

Request body

FieldTypeNotes
name requiredstring

Example Facebook.

platformstring | null

Optional pixel-platform key (facebook, google_ads, tiktok, bing, …) for the icon + conversion-pixel suggestion.

token_paramsarray of object

Maps the source's click macros onto Google UTM params. Each item is { slot, label, token }.

Responses

StatusMeaning
200

Created

PATCH/api/traffic-sources/{id}#

Update a traffic source

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
namestring
platformstring | null
token_paramsarray of object
archivedboolean

Responses

StatusMeaning
200

Updated

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

DELETE/api/traffic-sources/{id}#

Delete a traffic source

Unlinks the source from any campaigns (their traffic_source_id is set null) and removes it.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

Deleted

403

Resource exists but is not owned by the caller.

404

Resource does not exist.

Affiliate networks

Networks your offers belong to, with the parameter name each reads the click id from.

GET/api/affiliate-networks#

List affiliate networks

Responses

StatusMeaning
200

OK

POST/api/affiliate-networks#

Create an affiliate network

Request body

FieldTypeNotes
name requiredstring
conversion_paramstring

Default "clickid".

amazon_tagstring

Amazon Associates tag (e.g. yourtagid-20). When set, Amazon destination links are auto-tagged with ?tag={amazon_tag} at click time.

Responses

StatusMeaning
200

Created

PATCH/api/affiliate-networks/{id}#

Update an affiliate network

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

Body: object

Responses

StatusMeaning
200

OK

DELETE/api/affiliate-networks/{id}#

Delete an affiliate network

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

Postback events

Custom events a postback can record besides a sale, such as add_to_cart, upsell or lead.

GET/api/custom-events#

List custom postback events

Returns events (the account's own), built_in (sale, refund, chargeback) and presets (common starting points, not yet created).

Responses

StatusMeaning
200

OK

POST/api/custom-events#

Create a custom postback event

The slug is the value of event= on a postback, defaults to the label slugified, and cannot be changed later. With counts_revenue the event adds its payout to revenue and is deduped by txid. Without it, the event is counted at most once per click.

Request body

FieldTypeNotes
label requiredstring
slugstring
counts_revenueboolean

Responses

StatusMeaning
200

OK

400

label_required, bad_slug, reserved_slug or too_many_events

409

slug_taken

PATCH/api/custom-events/{id}#

Rename a custom event or change whether it counts revenue

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
labelstring
counts_revenueboolean

Responses

StatusMeaning
200

OK

DELETE/api/custom-events/{id}#

Delete a custom event

Recorded events stay. Postbacks using the slug get a 400 from then on.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

Reports

The campaign report, the dashboard overview, the event log and saved report views.

GET/api/report-views#

List saved report views

Returns views (each { id, name, columns, created_at, updated_at }) and active: "fewer", "all", or a view id as a string. A view is the report's columns in the user's order; reports open on the active one.

Responses

StatusMeaning
200

OK

POST/api/report-views#

Save a report view

columns is an ordered list of column ids (lander_views, unique_lander_views, visits, unique_visits, clicks, unique_clicks, ctr, unique_ctr, conversions, cr, refunds, chargebacks, epc, epv, unique_epv (all three gross), aov (net), gross_aov, gross_revenue (before refunds and chargebacks), reversed (refunds and chargebacks), revenue (net), cost (ad spend), custom:{slug}, take:{slug}, unique_take:{slug}). The view becomes active unless activate is false.

Request body

FieldTypeNotes
name requiredstring
columns requiredarray of string
activateboolean

Responses

StatusMeaning
200

OK

400

name_required, columns_required, bad_column, too_many_columns or too_many_views

409

name_taken

PUT/api/report-views/active#

Pick the view reports open on

Request body

FieldTypeNotes
view requiredstring

"fewer", "all", or a view id

Responses

StatusMeaning
200

OK

400

bad_view

404

not_found

PATCH/api/report-views/{id}#

Rename a report view or replace its columns

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
namestring
columnsarray of string

Responses

StatusMeaning
200

OK

409

name_taken

DELETE/api/report-views/{id}#

Delete a report view

If it was active, reports go back to "fewer".

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

GET/api/campaigns/{id}/stats#

Get full report for a campaign

Totals (visits/offer_clicks/conversions/refunds/chargebacks/revenue/ gross_revenue/reversed_revenue/custom/CTR/CR/EPC/ROI), by_day/ country/device/browser/referrer/hour, per-offer + per-lander performance, recent events, and breakdowns: grouped report rows for 10 dimensions (utm_campaign / utm_medium / utm_source / utm_content / utm_term / lander / offer / country / device / day), each row {key, visits, clicks, conversions, refunds, chargebacks, revenue, gross_revenue, reversed_revenue, cost, custom, ctr, cr, epc, aov, gross_aov}. cost (here and in totals) is the ad cost the campaign's cost model put on its visits (CPC), 0 without one. It never includes refunds or chargebacks, which are reversed_revenue (the app's Reversed column). aov (here and in totals) is net revenue per sale, after refunds and chargebacks; gross_aov is gross revenue per sale, before them. Both are 0 with no sale. epc (here and in totals) is gross revenue per offer click, before refunds and chargebacks. conversions counts sales and revenue is net of refunds and chargebacks. custom is keyed by event slug, each {count, revenue}, and the top-level custom_events lists the account's definitions with their labels. Offer clicks and conversions are attributed to the utm values of the visit that minted their click_id; the offer dimension attributes each visit to the offer its click routed to (keyed by offer name); the lander dimension is the page the click came from (visit referrer as host+path; pages running the property tag pass their full path via bgl_page, added only to links on the account's own tracker domains); missing values group under (none). Drill-down: pass any breakdown dimension as a query param (e.g. ?utm_campaign=Summer Sale, ?offer=My Offer, ?day=2026-07-09) and the whole report (totals, by_day, breakdowns) narrows to that traffic slice; filters combine and echo back in filters. Stacked report: ?group=utm_campaign,utm_medium,offer (up to 3 dimensions) returns report.rows as a tree, each row with children for the next level. group also takes region, city, browser, language, weekday and hour and custom tokens as param:<name>. Day, weekday, hour, by_day and by_hour count in the account time zone, or in tz when given; the response echoes it as timezone. Every extra param on the inbound link, sub1 to sub5 included, is kept on the visit, except click ids and personal fields. With no group the report groups by offer. passed_dims lists what the URLs really carried in the window: the utm_* tokens that had a value, then the param:<name> ones. On a direct lander the ad's URL counts even if the page's button drops it: the visit fills in from that visitor's page view. Custom tokens filter as ?param:adset_name=Broad. dim_labels holds the names the user gave this campaign's tokens, e.g. utm_medium: Ad Name. When the flow has a direct lander, direct_lander is true, and totals.lander_views and each row's lander_views count that page's property-tag page views, with lander_ctr as visits per lander view. Every row and the totals also count people, not rows: unique_visits and unique_clicks (unique_offer_clicks in totals) go by the IP and user agent of the visit that minted the click, and unique_lander_views by the property tag's visitor cookie, then IP and device. totals.unique_events counts the people behind each sale and custom event, keyed conversion or the event slug. Window is a rolling days count, or an explicit closed range via from/to (which override days).

Parameters

NameIn / typeNotes
id requiredpath integer
daysquery integer

Default 14.

fromquery string (date-time)
toquery string (date-time)
groupquery string

Comma-separated dimensions to stack, up to 3, e.g. utm_campaign,utm_medium,offer

breakdownsquery string

0 skips the ten fixed breakdowns (returned as empty arrays) and keeps everything else. Several times faster on a long window; the app's Report sends it. One of 0, 1. Default "1".

utm_campaignquery string
utm_mediumquery string
utm_sourcequery string
utm_contentquery string
utm_termquery string
landerquery string

Lander page host+path as returned in breakdowns.lander keys

offerquery string

Offer name as returned in breakdowns.offer keys

countryquery string
devicequery string
dayquery string

Day YYYY-MM-DD in the report's time zone

tzquery string

IANA time zone to count days and hours in. Defaults to the account time zone

Responses

StatusMeaning
200

OK

GET/api/observed-campaign-tags#

Distinct utm_campaign tags seen on properties (direct-link-tag picker)

Returns the distinct utm_campaign values actually seen arriving on the caller's properties/visits over the last 90 days, most-active first. Each item also carries a slug (the sanitized form of utm_campaign). Use to wire an already-running direct-link campaign to a BGL campaign: pick an unclaimed tag and add it to the campaign's direct_slugs. claimed_by is matched by slug across all of a campaign's tags and is non-null when another campaign already owns that tag.

Responses

StatusMeaning
200

OK

GET/api/tracker/overview#

Unified tracker dashboard rollup, PAGE VIEWS (sites + campaigns)

PAGE VIEWS live here. One-call rollup across BOTH event streams (property_events + tracker_events): totals (page_views, unique_visitors, visits, offer_clicks, conversions, revenue), by_day (merged daily activity), by_country / by_device / by_browser, per-property and per-campaign rollups (the per-property rollup gives page_views per site; each campaign row has visits, lander_views, offer_clicks, conversions, net revenue and direct_lander, and on a direct lander campaign EPV is revenue per lander view, else per visit), utm_campaigns (auto-detected Google utm_* tags with events/conversions/revenue), utm_sources (one row per utm_source, uncapped), and the 50 most recent events across both streams. In utm_campaigns and utm_sources a sale counts under the UTMs of the visit on its click, revenue is net, and events counts traffic only. This is the endpoint for "page views" and "page views per property". Page views here are SEPARATE from branded short-link clicks (GET /api/stats/overview); to report clicks AND page views together, read both endpoints and combine them.

Parameters

NameIn / typeNotes
daysquery integer

Default 14.

fromquery string (date-time)

Start of an explicit range (overrides days). With no to it stays open to now.

toquery string (date-time)

End of the explicit range.

tzquery string

IANA time zone by_day counts in. Defaults to the account time zone, else UTC. Echoed as timezone.

offer_idquery integer

Scope the rollup to a single offer: its offer_click events plus the conversions that share a click_id with one of them. Property events are excluded when set.

property_idquery integer

Scope the rollup to a single property's page events. Campaign events are excluded when set.

Responses

StatusMeaning
200

OK

GET/api/tracker/realtime#

Realtime, the last 30 minutes across every campaign and property

Google Analytics "Realtime overview" for the whole account. Always the last 30 minutes, so it takes no window. active_30 and active_5 are people active in the last 30 and 5 minutes; per_minute is 30 counts, oldest minute first. by_campaign is active people per campaign (campaign_id: null, name: "Not from a campaign" is people on a tagged page that no campaign claimed) with active_5. by_page is page views and people per page (host+path, newest title), most viewed first. events is the funnel in order (page views, visits, offer clicks, custom events, sales, then revenue events, refunds and chargebacks), each { type, label, count, people }. locations is people per city with Cloudflare's approximate lat/lon; located is how many people could be placed. A person is IP + device + browser on every row; an offer click or a postback counts under the visit on its click, so a postback is never a person on its own. Only traffic (page views, visits, lander views, offer clicks, outbound) makes a person active. Bots are left out. revenue_today is GROSS revenue since midnight (sales and revenue events plus property tag conversions, before refunds and chargebacks, which are for sales from other days), and net_revenue_today is the same after refunds and chargebacks. Both are counted in timezone: the tz param, else the account's time zone, else UTC. Each is null when it could not be read.

Parameters

NameIn / typeNotes
tzquery string

IANA time zone that today's midnight is counted in (revenue_today). Defaults to the account's zone, then UTC.

Responses

StatusMeaning
200

OK

GET/api/tracker/events#

Searchable / filterable / sortable unified UTM event log

Event log across BOTH streams with full search/filter/sort over auto-detected Google UTM tags (utm_source / utm_medium / utm_campaign / utm_term / utm_content). Returns the matching page of events plus facets (distinct UTM values in the window) and total (full match count). Only visit events store city, region and IP, so other campaign events report the values of the visit that shares their click_id. An event with no matching visit leaves them null.

Parameters

NameIn / typeNotes
daysquery integer

Default 14.

fromquery string (date-time)

Start of an explicit range (overrides days).

toquery string (date-time)

End of the explicit range. Defaults to now.

qquery string

Free-text across utm_*

streamquery string

Ignored when campaign_id, offer_id, property_id, or link_id is set (each forces its own single stream). One of all, property, campaign. Default "all".

campaign_idquery integer

Scope the log to a single campaign (forces stream=campaign).

eventquery string

Exact event_type filter

utm_sourcequery string
utm_mediumquery string
utm_campaignquery string
utm_termquery string
utm_contentquery string
offer_idquery integer

Scope the log to a single offer (forces stream=campaign): its offer_click events plus the conversions sharing a click_id with one of them.

property_idquery integer

Scope the log to a single property (property/site stream only).

link_idquery integer

Scope the log to a single short link: its resolver clicks from link_clicks, returned as stream=link, event_type=click rows. For a plain link that has no offer/campaign record behind it.

sortquery string

One of ts, revenue, stream, source_name, event_type, country, region, city, ip, device, browser, referrer, page_path, utm_source, utm_medium, utm_campaign, utm_term, utm_content. Default "ts".

dirquery string

One of asc, desc. Default "desc".

limitquery integer

Default 200.

offsetquery integer

Default 0.

Responses

StatusMeaning
200

OK

Properties

Site containers for the universal /t.js tag, which records page views, engagement, outbound clicks and conversions on every page of a site.

GET/api/properties#

List properties with quick-look stats

A property is a GTM/GA-style site container. Each property has a public property_key and an install snippet: one universal tag the user pastes on every page of their site. Pages auto-report pageviews, time-on-page, scroll, outbound clicks, and conversions, and auto-attribute to a campaign when the visitor carries that campaign's click.

Page views are metered on the Free plan only (10k per month). Paid plans are unlimited. When a user exceeds their monthly page-view allowance, new page-view events stop recording until the cycle resets; outbound/conversion events keep recording, and link clicks (the Links section) remain unlimited.

Responses

StatusMeaning
200

OK

POST/api/properties#

Create a property

Server mints a 16-char base62 property_key. Requires an active custom domain: the install tag is served from the user's own domain so it stays first-party to their site (required for tracking to work on iOS/Safari, because a tag loaded cross-site from offerswap.com gets its visitor cookie partitioned/blocked). Defaults to the user's first active custom domain; pass domain_id to pin a specific one. If the user has no active custom domain, returns 400 { error: "domain_required" }.

The response includes tracking_domain (the bound hostname) and the install snippet: a single GA/Facebook-style inline <script> block (an IIFE that defines a queueing bglFireConversion stub and then injects https://{tracking_domain}/t.js?p={property_key} asynchronously). The stub ensures a thank-you page calling window.bglFireConversion(revenue) before the async tag finishes loading does not lose the conversion (the tag drains the queue on load).

Request body

FieldTypeNotes
name requiredstring
site_urlstring

Optional primary site URL (informational).

domain_idinteger

Optional id of one of the user's active custom domains to serve the tag from. Defaults to the first active custom domain.

Responses

StatusMeaning
200

Created

GET/api/properties/{id}#

Get a property with its install snippet and linked campaigns

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

PATCH/api/properties/{id}#

Update a property

Patch any subset of: name, site_url, domain_id, archived. domain_id must reference one of the user's active custom domains (a property never falls back to offerswap.com); re-binding regenerates the install snippet.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

Body: object

Responses

StatusMeaning
200

OK

DELETE/api/properties/{id}#

Archive a property

Properties are never deleted. This sets archived_at (the tag stops counting, page views stay) and returns { ok, archived }. PATCH archived=false restores it.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

PUT/api/properties/{id}/campaigns#

Replace the campaigns linked to a property

Many-to-many link, for organisation and the source split in reports. Stitching still happens automatically by click regardless of links.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
items requiredarray of object

Responses

StatusMeaning
200

OK

GET/api/properties/{id}/stats#

Get full GA-style report for a property

Totals (page_views, unique_visitors, outbound, conversions, revenue, avg_time_on_page_ms, avg_scroll_pct, CR), by_day, by_page (top paths), by_source (organic vs each stitched campaign), by_country / by_device / by_browser / by_referrer, and the 50 most recent events.

Parameters

NameIn / typeNotes
id requiredpath integer
daysquery integer

Default 14.

Responses

StatusMeaning
200

OK

GET/api/property-pages#

List pages seen across all properties (usable as campaign landers)

Returns the distinct pages observed across all the caller's properties (their pageview stream), most-viewed first. Any page can be used as a campaign lander: POST its url to /api/landers, then wire the lander into a campaign flow.

Responses

StatusMeaning
200

OK

Split tests

Test a page's headline, buttons or images without rebuilding it. The property tag swaps each variant in per visitor, and a revenue bandit moves traffic toward the variant making the most money per visitor.

GET/api/split-tests#

List split tests with their live results

Every split test, newest first, with its arms and results: per arm views (people who saw it), clicks, buyers, sales, gross, net (after refunds and chargebacks), weight (its share of new visitors right now) and p_best (how often the bandit drew it as best). Arm a is the page as it is. burn_in is true until the test has burn_in_target counted visitors (200), and the split is even until then. missing counts views where the tested element was no longer on the page as scanned (missing_last, found_last say when). Also returns ai_credits { used, limit, left, resets_at }.

Parameters

NameIn / typeNotes
include_archivedquery string

One of 1.

Responses

StatusMeaning
200

OK

POST/api/split-tests#

Create a split test (a draft)

elements are scanned elements (from POST /api/split-tests/scan) the test changes, each { id, kind: text|image, role, selector, text, match?, src, bg_image?, rect }. Arm a (the original) is added for you. arms are up to 3 variants, each { name, source?, changes } where a change is { element, text?, src?, color?, background? }. In text, *words* in stars take the page's highlight style. Start it with PATCH { status: "running" }.

Request body

FieldTypeNotes
page_url requiredstring
namestring
page_titlestring
devicestring

One of mobile, desktop.

property_idinteger
screenshot_urlstring
screenshot_winteger
screenshot_hinteger
elements requiredarray of object
candidatesarray of object
armsarray of object

Responses

StatusMeaning
201

Created

400

bad_url, no_elements, invalid_property, bad_changes or too_many_tests

POST/api/split-tests/scan#

Scan a page for things to test

Opens the page in a headless browser (a phone unless device is desktop), with tracking pixels and the property tag blocked so the scan is never counted. Returns scan: a screenshot of the first six screens (screenshot_url, width, height in CSS pixels), the elements found there (every line of text as headline, subheadline, heading or text, buttons as role cta, images) with positions, and whether the page carries this account's property tag (has_tag, property_id). A test cannot start without the tag. Unless browse is false, the browser stays open for 5 minutes and session lets POST /api/split-tests/scan/click tap through the page. Takes about 15 seconds.

Request body

FieldTypeNotes
url requiredstring
devicestring

One of mobile, desktop.

browseboolean

Responses

StatusMeaning
200

OK

400

bad_url

502

scan_failed

503

scan_unavailable

POST/api/split-tests/scan/click#

Tap a scanned page to reach a later step

Browse mode. Taps the scan's open page at x, y (the screenshot's CSS pixels), for example a quiz's start button, and returns view: a new screenshot and that screen's elements, with ids of their own and later: true. The tag changes a later element whenever it appears, so a quiz's second screen can be tested. navigated: true means a different page loaded; its elements cannot go in this test.

Request body

FieldTypeNotes
session requiredstring
x requirednumber
y requirednumber
stepinteger
devicestring

One of mobile, desktop.

Responses

StatusMeaning
200

OK

400

bad_point

410

scan_expired (the browser closed after 5 idle minutes)

POST/api/split-tests/scan/close#

Close a scan's open browser

Request body

FieldTypeNotes
sessionstring

Responses

StatusMeaning
200

OK

POST/api/split-tests/generate#

Write variants with AI

Cloudflare Workers AI writes count (1 to 3) variants of the text elements passed. mode: auto also picks the 1 to 3 elements that matter most (pass every scanned text element). One AI credit per call that returns usable copy: Free 0, Small 20, Medium 50, Large 150 a month. Returns arms (ready to save), picked and ai_credits. The copy keeps the page's facts, adds no claims, prices or guarantees, and has no dashes.

Request body

FieldTypeNotes
modestring

One of variants, auto.

countinteger
page_urlstring
page_titlestring
elements requiredarray of object
contextarray of string
test_idinteger

Responses

StatusMeaning
200

OK

400

no_text

402

ai_credits_exhausted

502

ai_failed (no credit used)

POST/api/split-tests/images#

Upload an image for an image variant

The request body is the image itself (JPG, PNG, WebP or GIF, up to 5 MB) with its Content-Type. Returns { url } for a change's src.

Request body

Body: string (binary)

Responses

StatusMeaning
200

OK

400

bad_type, empty or too_big

GET/api/split-tests/{id}#

Get a split test

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

404

not_found

PATCH/api/split-tests/{id}#

Edit, start, pause or end a split test

status: running starts or resumes (needs the property tag on the page, a variant with a change, and no other running test on the page), paused shows the page as it is, ended with winner_arm keeps showing that arm to everyone (none, or a, shows the original). arms: with a key, edit that arm (active: false retires it and keeps its numbers); without one, add a variant. Once a test has run, its elements and an arm's changes are locked (409 arm_locked, 409 test_started). remove_arms deletes draft arms.

Parameters

NameIn / typeNotes
id requiredpath integer

Request body

FieldTypeNotes
namestring
statusstring

One of running, paused, ended.

winner_armstring
elementsarray of object
armsarray of object
remove_armsarray of string
burn_ininteger
floornumber
reward_weightnumber
archivedboolean

Responses

StatusMeaning
200

OK

409

tag_missing, page_has_running_test (another test runs on this page; test_id names it), page_has_winner (an ended test's winner still changes an element this test changes; test_id names it), arm_locked, test_started or test_ended

DELETE/api/split-tests/{id}#

Archive a split test

A running test is paused first. Nothing is deleted.

Parameters

NameIn / typeNotes
id requiredpath integer

Responses

StatusMeaning
200

OK

Public endpoints

Served on offerswap.com and on every custom domain an account connects. No auth.

GEThttps://offerswap.com/{code}#

Short link or campaign link

Resolves a short link (by code, or by alias on a custom domain) or a campaign. A short link logs the click (country, device, browser, referrer, language), forwards the incoming query parameters onto the destination, and redirects to exactly the saved URL. On a phone, a destination that belongs to an app (Amazon, YouTube, Instagram, Spotify, eBay and more) opens the app and falls back to the website when it is not installed; inside Facebook's, Instagram's or TikTok's own browser, which cannot open apps, the tap moves to Safari or Chrome first. A short link's phone_open (app, browser, stay) overrides that.

A campaign link mints a click id, logs a visit with the ad's UTM parameters and any other tokens, and routes by the campaign's flow to a landing page or an offer. On a custom domain, codes resolve only to that domain owner's links and campaigns; an unknown hostname returns 404.

GEThttps://offerswap.com/c/{alias}#

Collection rotator

Sends each visit to a random member of the collection with this rotator alias, then resolves it like a short link.

GEThttps://offerswap.com/click#

Landing page click URL

The one URL a landing page's button points to, the same for every campaign. It always lands on an offer, chosen by the campaign's flow, never on a landing page and never on an error. The campaign comes from the visitor's bgl_clk_{code} cookie (they arrived on the campaign link), ?cmp={code}, ?cid={click_id}, or ?utm_campaign= matching one of the campaign's direct-link tags (the ad went straight to the page). With no live offer it goes to the campaign's fallback_url, then the platform default.

GEThttps://offerswap.com/c/{click_id}/out#

Landing page click by click id

An older form of /click that carries the click id in the path. Routes to an offer the same way.

GEThttps://offerswap.com/postback/u/{token}#

Postback URL

The account's one postback URL (Voluum-style), returned as postback_url on GET /api/me. Paste it into any network's S2S settings or your own webhook (n8n, Zapier, a store's order webhook). Parameters:

  • clickid (alias cid): required, the click id the offer URL received.
  • payout, currency, txid: optional. A sale sent with no payout books the payout of the offer its click went to, when that offer has one set.
  • event: none is a sale. refund and chargeback are built in, matched by click, and subtract from revenue (send the amount as 67 or -67, or leave it out to reverse whatever is booked on the click). Anything else must be a custom event from /api/custom-events. A blank or unknown event returns 400 and records nothing.
  • email (alias em): optional. Hashed with SHA-256 and sent to the campaign's ad platform pixel so the platform can match the sale. Never stored.

Sales are deduped by txid: at most one per account and txid. A re-fire with the same txid is ignored, and one with a different payout updates the stored revenue. A postback with no txid is always recorded. Which events reach the campaign's ad platform pixel is the campaign's pixel_events.

GEThttps://offerswap.com/postback/n/{token}#

Old network postback URL

A network's postback URL from before 2026-11-07. No longer handed out, but it still records sales exactly like the account's postback URL and still reads that network's saved parameter names.

GEThttps://offerswap.com/postback/{token}#

Old campaign postback URL

A campaign's postback URL from before 2026-11-07. No longer handed out, but it still records sales exactly like the account's postback URL, crediting the click's own campaign.

GEThttps://offerswap.com/t.js#

Universal property tag

<script async src="https://{your-custom-domain}/t.js?p={property_key}"></script> on every page of a site. It sets a first-party visitor cookie and records page_view on load, time on page and scroll depth on leave, outbound on clicks off the site, and conversion when the page sets window.bglConversion = true (optionally window.bglRevenue) or calls window.bglFireConversion(revenue). It reads UTM parameters off the landing URL and keeps them for the visit. Serve it from your own custom domain: on offerswap.com its cookie is blocked as third party on iOS and Safari. Page views count toward the plan's monthly allowance.

POSThttps://offerswap.com/t/collect#

Property tag beacon

Where /t.js sends its events. Resolves the property by its public key. CORS open.

GEThttps://offerswap.com/p.js#

Lander pixel

<script src="https://offerswap.com/p.js?c={campaign_code}"></script> in a lander's head. Records lander_view, the outbound click back to the campaign, engagement, and conversion when the page sets window.bglConversion = true or calls window.bglFireConversion(revenue). For a whole site, use the property tag /t.js instead.

POSThttps://offerswap.com/p/collect#

Lander pixel beacon

Where /p.js sends its events.