TargetingSet Campaign Targeting

Set Campaign Targeting

Replace a campaign's targeting rules wholesale.

curl -X POST "https://api.5centscdn.com/v2/ad-manager/101/campaigns/cmp_4c19/targeting" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "include_tags": [
    "sports",
    "live"
  ],
  "exclude_tags": [
    "kids"
  ],
  "categories": [
    3,
    7
  ],
  "content_ids": [
    "1024",
    "1025"
  ],
  "placements": [
    "preroll"
  ],
  "devices": [
    1,
    3
  ],
  "languages": [
    "en",
    "es"
  ],
  "oses": [
    "iOS",
    "Android"
  ],
  "browsers": [
    "Chrome",
    "Safari"
  ],
  "continent_geoname_ids": [
    6255149
  ],
  "country_geoname_ids": [
    6252001
  ],
  "subdivision_1_geoname_ids": [
    5332921
  ],
  "subdivision_2_geoname_ids": [
    5391959
  ],
  "city_geoname_ids": [
    5391811
  ]
}'
{
  "result": "success"
}
POST
/ad-manager/{pid}/campaigns/{cid}/targeting
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key (sent in header)

path
pidinteger
Required

ID of the Ad Manager project.

path
cidstring
Required

ID of the campaign.

Content-Typestring
Required

The media type of the request body

Options: application/json
include_tagsarray

Content tags to require a match on.

categoriesarray

IAB content category IDs to target.

content_idsarray

Content allowlist. Replaces the legacy stream_ids field.

devicesarray

IAB device-type IDs (1=Mobile/Tablet-General, 2=Personal Computer, 3=Connected TV, 4=Phone, 5=Tablet, 6=Connected Device, 7=Set Top Box, 8=OOH Device).

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. Provide your API key in the header.

Path Parameters

pidinteger
Required

ID of the Ad Manager project.

Example:
101
cidstring
Required

ID of the campaign.

Example:
cmp_4c19

Body

application/json
include_tagsarray

Content tags to require a match on.

Example:
["sports","live"]
exclude_tagsarray
Example:
["kids"]
categoriesarray

IAB content category IDs to target.

Example:
[3,7]
content_idsarray

Content allowlist. Replaces the legacy stream_ids field.

Example:
["1024","1025"]
devicesarray

IAB device-type IDs (1=Mobile/Tablet-General, 2=Personal Computer, 3=Connected TV, 4=Phone, 5=Tablet, 6=Connected Device, 7=Set Top Box, 8=OOH Device).

Example:
[1,3]
languagesarray
Example:
["en","es"]
osesarray
Example:
["iOS","Android"]
browsersarray
Example:
["Chrome","Safari"]
country_geoname_idsarray
Example:
[6252001]
city_geoname_idsarray
Example:
[5391811]

Responses

resultstring

Operation outcome.

Allowed values:successerror