How to Configure Geo and Device Targeting via the CAKE API

This article will cover the following:


Overview

The Geo & Device Targeting API lets you read and update targeting rules on your offers programmatically. Use it to manage geo restrictions at scale or sync targeting configurations from an external system.


Get Offer Geo Targets

GET /api/2/offer_geo_targets.json
ParameterTypeRequiredDescription
offer_idintegerYesThe unique ID of the offer whose geo targets you want to retrieve.

Sample request

GET https://yourplatform.cake.com/api/2/offer_geo_targets.json ?api_key=YOUR_API_KEY &offer_id=12345

Sample response

{ "request_status": "Success", "offer_id": 12345, "geo_targets": [ {"country_id": 1, "country_code": "US", "country_name": "United States", "action": "allow"}, {"country_id": 39, "country_code": "CA", "country_name": "Canada", "action": "allow"} ] }

Update Offer Geo Targets

Adds or removes country-level targeting rules on an offer. Pass a comma-separated list of country codes with an action to allow or block those countries.

POST /api/2/update_offer_geo_targets.json
ParameterTypeRequiredDescription
offer_idintegerYesThe unique ID of the offer to update.
countriesstringYesComma-separated ISO 3166-1 alpha-2 country codes (e.g., US,CA,GB).
actionstringYesEither allow or block.

Sample request

POST https://yourplatform.cake.com/api/2/update_offer_geo_targets.json { "api_key": "YOUR_API_KEY", "offer_id": 12345, "countries": "US,CA,GB", "action": "allow" }

Sample response

{ "request_status": "Success", "offer_id": 12345, "updated_countries": ["US", "CA", "GB"], "action": "allow" }

Get Countries

Returns all countries available in CAKE. Use this to look up valid country IDs and ISO codes before configuring targeting rules.

GET /api/2/countries.json
ParameterTypeRequiredDescription
country_idintegerNoFilter to a specific country by its CAKE numeric ID.
country_codestringNoFilter to a specific country by its ISO 3166-1 alpha-2 code (e.g., DE).

Sample request

GET https://yourplatform.cake.com/api/2/countries.json?api_key=YOUR_API_KEY&country_code=DE

Sample response

{ "request_status": "Success", "countries": [{"country_id": 57, "country_code": "DE", "country_name": "Germany"}] }

Get Device Types

GET /api/2/device_types.json
ParameterTypeRequiredDescription
device_type_idintegerNoFilter to a specific device type by its CAKE numeric ID.

Sample request

GET https://yourplatform.cake.com/api/2/device_types.json?api_key=YOUR_API_KEY

Sample response

{ "request_status": "Success", "device_types": [ {"device_type_id": 1, "device_type_name": "Desktop"}, {"device_type_id": 2, "device_type_name": "Smartphone"}, {"device_type_id": 3, "device_type_name": "Tablet"} ] }

Get Operating Systems

GET /api/2/os_versions.json
ParameterTypeRequiredDescription
os_version_idintegerNoFilter to a specific OS version by ID.

Sample request

GET https://yourplatform.cake.com/api/2/os_versions.json?api_key=YOUR_API_KEY

Sample response

{ "request_status": "Success", "os_versions": [ {"os_version_id": 1, "os_version_name": "iOS"}, {"os_version_id": 2, "os_version_name": "Android"}, {"os_version_id": 3, "os_version_name": "Windows"}, {"os_version_id": 4, "os_version_name": "macOS"} ] }

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.