Browse the help center

Create site location targeting

Creates a location targeting rule for the specified site at country, region, or city granularity.

Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/site/{siteId}/targeting/location/create.do

Creates a location targeting rule for the specified site at country, region, or city granularity. The countryCode is required; regionName and cityName are optional for finer targeting. If cityName is provided, regionName must also be provided. Requires LOCATION targeting permission.

Path Params

siteId integer required

Unique numeric ID of the site

3001

Form Params

rule string required

Targeting rule type — INCLUDE for whitelist or EXCLUDE for blacklist

INCLUDE

countryCode string required

ISO alpha-2 country code (e.g. US, GB, DE)

US

regionName string

Region name within the country (optional, for region-level targeting)

California

cityName string

City name within the region (optional, requires regionName to be set)

Los Angeles

Responses

200

Success

400

Invalid country code, region, or city name

401

Unauthorized

403

Forbidden

404

Site not found

500

Internal server error

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.