CAKE API — Smart Links & Routing

This article will cover the following:

Why use this API?
Use the Smart Links & Routing API to configure dynamic offer routing — automatically directing affiliate traffic to the highest-performing or most relevant offer based on geo, device, availability, or custom weighting rules.
Authentication: All CAKE API requests require your api_key parameter. Find yours under Setup → System Access → API Keys.

Overview

Smart Links in CAKE allow a single affiliate tracking link to dynamically route incoming traffic to one of several offers based on configurable rules. Rather than assigning an affiliate to a single offer, smart links evaluate each click in real time and select the best matching destination — improving fill rates, maximizing EPC, and reducing the manual overhead of managing multiple campaigns.

Routing rules can be based on geographic location, device type, offer availability (cap status), performance weighting, or explicit priority ordering. When a smart link is triggered, CAKE evaluates all attached offers in rule order and routes the click to the first qualifying offer. If no offers qualify, a fallback URL is used.

Smart links are managed in CAKE under Affiliates → Smart Links and can be created and configured via the API, enabling programmatic link management at scale.


Key Concepts

  • Smart Link — A special CAKE tracking link that dynamically routes each click to one of several configured offers based on targeting rules and weighting. Assigned to an affiliate rather than a specific offer.
  • Routing Rule — A conditional logic block within a smart link that maps incoming traffic attributes (geo, device, etc.) to a specific offer destination.
  • Offer Weight — A numeric value assigned to an offer within a smart link that controls how often it receives traffic when multiple offers qualify. Higher weights receive proportionally more traffic.
  • Priority — The evaluation order of routing rules within a smart link. Rules are evaluated in ascending priority order; the first matching rule wins.
  • Fallback URL — The destination for clicks that don't match any routing rule within the smart link. Prevents lost traffic when no offers qualify.
  • Fill Rate — The percentage of smart link clicks that successfully route to a qualifying offer (vs. falling back). A key performance indicator for smart link configurations.
  • Cap-Aware Routing — A smart link routing mode that automatically skips offers that have reached their conversion cap, ensuring traffic continues to flow to available offers.

Available Actions


When to use: Retrieve all smart links configured for your network or a specific affiliate — use for auditing routing configurations, building management dashboards, or syncing smart link data to external systems.
GET/api/2/smart_links.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
smart_link_idintegerNoFilter to a single smart link by its CAKE ID.
affiliate_idintegerNoFilter smart links belonging to a specific affiliate.
smart_link_statusstringNoFilter by status: active, inactive.
start_at_rowintegerNoPagination offset. Default 0.
row_limitintegerNoMax records to return. Default 100, max 500.

Sample request

GET https://yourdomain.cakemarketing.com/api/2/smart_links.json?api_key=YOUR_API_KEY&affiliate_id=67890&smart_link_status=active

Sample response

{ "request_status": "Success", "response": { "smart_links": [ { "smart_link_id": 301, "smart_link_name": "Finance Rotator - US", "affiliate_id": 67890, "smart_link_status": "active", "tracking_url": "https://track.yourdomain.com/sl?id=301&aff_id=67890", "fallback_url": "https://yourdomain.com/no-offer", "offer_count": 3 } ], "total_rows": 1 } }

When to use: Create a new smart link for an affiliate programmatically — use when automating affiliate onboarding where smart links replace standard single-offer campaigns, or when building bulk link creation tools.
POST/api/2/smart_link.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
affiliate_idintegerYesThe affiliate to create the smart link for.
smart_link_namestringYesA descriptive name for the smart link.
fallback_urlstringNoURL to redirect to when no offers qualify for the click.
smart_link_statusstringNoactive | inactive. Default: active.

Sample request

POST https://yourdomain.cakemarketing.com/api/2/smart_link.json { "api_key": "YOUR_API_KEY", "affiliate_id": 67890, "smart_link_name": "Finance Rotator - US", "fallback_url": "https://yourdomain.com/no-offer", "smart_link_status": "active" }

Sample response

{ "request_status": "Success", "response": { "smart_link_id": 302, "smart_link_name": "Finance Rotator - US", "affiliate_id": 67890, "tracking_url": "https://track.yourdomain.com/sl?id=302&aff_id=67890", "smart_link_status": "active" } }

When to use: Attach an offer to an existing smart link with optional weighting and priority — use when expanding a rotator with new advertiser offers or when automating offer assignment based on performance data.
POST/api/2/smart_link_offer.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
smart_link_idintegerYesThe smart link to add the offer to.
offer_idintegerYesThe offer to attach to the smart link.
offer_weightintegerNoTraffic weight (1–100). Higher values receive proportionally more traffic. Default: 1.
priorityintegerNoEvaluation order for this offer within the smart link. Lower numbers are evaluated first. Default: 1.

Sample request

POST https://yourdomain.cakemarketing.com/api/2/smart_link_offer.json { "api_key": "YOUR_API_KEY", "smart_link_id": 302, "offer_id": 1042, "offer_weight": 60, "priority": 1 }

Sample response

{ "request_status": "Success", "response": { "smart_link_id": 302, "offer_id": 1042, "offer_weight": 60, "priority": 1, "added": true } }


If you have any questions, please reach out to your dedicated CAKE Client Success Manager/Account Manager or contact the CAKE Support Team at support@getCAKE.com.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.