This article will cover the following:
Use the Campaigns API to automate campaign creation when affiliates are approved for offers, retrieve tracking links programmatically, update campaign creatives in bulk, or sync campaign status changes from external systems.
api_key parameter. Find yours under Setup → System Access → API Keys.
Overview
A Campaign is the unique tracking relationship between an affiliate and an offer — when an affiliate is approved to promote an offer, a campaign is generated that produces a unique tracking link. Creatives are promotional assets (banner ads, text links, email copy) assigned to campaigns. Landing Pages are destination URLs affiliates drive traffic toward. Together these form the core infrastructure through which CAKE routes traffic and attributes revenue.
Key Concepts
- Campaign — Links a specific affiliate to a specific offer. Generates the affiliate's tracking link.
- Tracking Link — Unique URL encoding affiliate ID, offer ID, and campaign parameters for attribution.
- Display Link Type — How the tracking link is formatted: standard, encoded, or vanity/white-label.
- Sub Affiliate — Additional tracking dimension appended to the campaign tracking link.
- Campaign Status —
active,paused,deleted. Only Active campaigns record clicks. - Creative Status —
active,paused,deleted. Determines availability for campaign assignment.
Available Actions
Get Campaigns
Retrieves campaigns matching the filter criteria. Use to audit active campaigns, pull campaigns for a specific affiliate or offer, or retrieve tracking links in bulk.
GET /api/2/campaigns.json| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your CAKE API key. |
| campaign_id | integer | No | Filter to a single campaign. |
| offer_id | integer | No | Filter campaigns for a specific offer. |
| affiliate_id | integer | No | Filter campaigns for a specific affiliate. |
| campaign_status | string | No | active | paused | deleted |
| start_at_row | integer | No | Pagination offset. Default 1. |
| row_limit | integer | No | Max records. Default 100, max 5000. |
Sample request
GET https://yourdomain.cakemarketing.com/api/2/campaigns.json?api_key=YOUR_API_KEY&offer_id=12345&affiliate_id=67890&campaign_status=active&start_at_row=1&row_limit=50Sample response
{
"request_status": "Success",
"response": {
"campaigns": [
{
"campaign_id": 98001,
"offer_id": 12345,
"offer_name": "Auto Insurance Quote - US",
"affiliate_id": 67890,
"affiliate_name": "MediaBridge Partners",
"campaign_status": "active",
"tracking_link": "https://yourdomain.cakemarketing.com/rd/r.php?sid=98001&aff_id=67890",
"creative_id": 4421,
"sub_affiliate": "email_blast_june",
"date_created": "2026-01-15T09:00:00Z"
}
],
"total_rows": 1
}
}Create Campaign
Creates a new campaign linking an affiliate to an offer. Use to programmatically approve affiliates and generate tracking links without navigating through the CAKE UI.
POST /api/2/campaign.json| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your CAKE API key. |
| offer_id | integer | Yes | Offer to create the campaign under. Must be active. |
| affiliate_id | integer | Yes | Affiliate to approve for the offer. |
| display_link_type_id | integer | No | 1=Standard, 2=Encoded, 3=Vanity tracking link format. |
| creative_id | integer | No | Default creative to assign. |
| landing_page_id | integer | No | Default landing page to assign. |
| sub_affiliate | string | No | Pre-populate the s1 value for this campaign. |
| coupon_code | string | No | Coupon code to attach. |
Sample request
POST https://yourdomain.cakemarketing.com/api/2/campaign.json
{
"api_key": "YOUR_API_KEY",
"offer_id": 12345,
"affiliate_id": 67890,
"display_link_type_id": 1,
"creative_id": 4421
}Sample response
{
"request_status": "Success",
"campaign": {
"campaign_id": 98002,
"campaign_status": "active",
"offer_id": 12345,
"affiliate_id": 67890,
"tracking_link": "https://yourdomain.cakemarketing.com/rd/r.php?sid=98002&aff_id=67890",
"date_created": "2026-06-19 09:45:00"
}
}Update Campaign
Updates a campaign's status, creative, or landing page. Use to pause campaigns when offers expire, swap creatives, or activate campaigns on a schedule.
POST /api/2/update_campaign.json| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your CAKE API key. |
| campaign_id | integer | Yes | ID of the campaign to update. |
| campaign_status | string | No | active | paused | deleted |
| creative_id | integer | No | New creative to assign. |
| landing_page_id | integer | No | New landing page to assign. |
Sample request
POST https://yourdomain.cakemarketing.com/api/2/update_campaign.json
{
"api_key": "YOUR_API_KEY",
"campaign_id": 98001,
"campaign_status": "paused",
"creative_id": 4422
}Sample response
{
"request_status": "Success",
"campaign": {
"campaign_id": 98001,
"campaign_status": "paused",
"creative_id": 4422
}
}Get Creatives
Retrieves creative assets associated with an offer. Use to enumerate available creatives before assigning to a campaign.
GET /api/2/creatives.json| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your CAKE API key. |
| creative_id | integer | No | Filter to a specific creative. |
| offer_id | integer | No | Filter creatives for a specific offer. |
| creative_type_id | integer | No | Filter by creative type (1=Banner, 2=Text Link, 3=Email, 4=HTML). |
| creative_status | string | No | active | paused | deleted |
Sample request
GET https://yourdomain.cakemarketing.com/api/2/creatives.json?api_key=YOUR_API_KEY&offer_id=12345&creative_status=activeSample response
{
"request_status": "Success",
"creatives": [
{
"creative_id": 4421,
"creative_name": "Banner 300x250",
"creative_type": "Banner",
"offer_id": 12345,
"creative_status": "active",
"width": 300,
"height": 250
}
]
}Get Landing Pages
Retrieves landing pages associated with an offer. An offer can have multiple landing pages enabling A/B testing and geo-targeted routing.
GET /api/2/landing_pages.json| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your CAKE API key. |
| landing_page_id | integer | No | Filter to a specific landing page. |
| offer_id | integer | No | Filter landing pages for a specific offer. |
| landing_page_status | string | No | active | paused | deleted |
Sample request
GET https://yourdomain.cakemarketing.com/api/2/landing_pages.json?api_key=YOUR_API_KEY&offer_id=12345&landing_page_status=activeSample response
{
"request_status": "Success",
"landing_pages": [
{
"landing_page_id": 881,
"landing_page_name": "Main LP - US",
"offer_id": 12345,
"url": "https://safedrive.example.com/quote",
"landing_page_status": "active"
}
]
}You may also be interested in:
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.