campaign-schema.
Error
{
"$id": "Error",
"type": "object",
"properties": {
"message": { "type": "string" },
"action": { "type": "string" },
"code": { "type": "string" },
"data": { "type": "object", "additionalProperties": true }
},
"required": ["message", "action"]
}
CampaignFilters
Used in create/update campaign body. See Campaign filters for allowed values and Campaign create for defaults. Must send (top-level underfilters): geolocation, referer, query, domain, browser, browser_language, isp, os, user_agent, blacklist.
{
"$id": "CampaignFilters",
"type": "object",
"required": [
"geolocation",
"referer",
"query",
"domain",
"browser",
"browser_language",
"isp",
"os",
"user_agent",
"blacklist"
],
"properties": {
"facebook": { "type": "boolean", "default": false },
"google": { "type": "boolean", "default": false },
"tiktok": { "type": "boolean", "default": false },
"kwai": { "type": "boolean", "default": false },
"taboola": { "type": "boolean", "default": false },
"pinterest": { "type": "boolean", "default": false },
"yandex": { "type": "boolean", "default": false },
"mgid": { "type": "boolean", "default": false },
"outbrain": { "type": "boolean", "default": false },
"sms": { "type": "boolean", "default": false },
"revcontent": { "type": "boolean", "default": false },
"adskeeper": { "type": "boolean", "default": false },
"newsbreak": { "type": "boolean", "default": false },
"adspy": { "type": "boolean", "default": true },
"deny_always": {
"type": "boolean",
"default": false,
"description": "DANGER: true = in_review mode, always shows safe page."
},
"bots": { "type": "boolean", "default": true },
"proxy": { "type": "boolean", "default": true },
"cloakup_ai": { "type": "boolean", "default": true },
"geolocation": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"countries": {
"type": "array",
"maxItems": 256,
"items": { "type": "string", "pattern": "^[A-Z]{2}$" }
}
}
},
"state": {
"type": "object",
"properties": {
"allow": { "type": "boolean" },
"states": { "type": "array", "maxItems": 100, "items": { "type": "string" } }
}
},
"city": {
"type": "object",
"properties": {
"allow": { "type": "boolean" },
"cities": { "type": "array", "maxItems": 100, "items": { "type": "string" } }
}
},
"network_type": {
"type": "object",
"properties": {
"allow": { "type": "boolean" },
"types": {
"type": "array",
"items": { "enum": ["residential", "business", "wireless", "hosting", "unknown"] }
}
}
},
"device": {
"type": "object",
"properties": {
"allow": { "type": "boolean" },
"devices": {
"type": "array",
"items": { "enum": ["desktop", "smartphone", "tablet", "unknown"] }
}
}
},
"referer": {
"type": "object",
"required": ["block_null", "domains"],
"properties": {
"block_null": { "type": "boolean" },
"allow": { "type": "boolean", "default": true },
"domains": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"query": {
"type": "object",
"required": ["params", "condition", "rules"],
"properties": {
"allow": { "type": "boolean", "default": true },
"remove_params": { "type": "boolean", "default": false },
"params": {
"type": "object",
"additionalProperties": { "type": "array", "items": { "type": "string" } }
},
"condition": { "enum": ["some", "every"] },
"rules": {
"type": "object",
"additionalProperties": {
"enum": ["equals", "contains", "starts_with", "ends_with"]
}
}
}
},
"domain": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"domains": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"browser": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"browsers": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"browser_language": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"languages": {
"type": "array",
"maxItems": 255,
"items": { "type": "string", "pattern": "^[a-z]{2}(-[a-z]{2})?$" }
}
}
},
"isp": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"isps": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"os": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"os": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"user_agent": {
"type": "object",
"properties": {
"allow": { "type": "boolean", "default": true },
"user_agents": { "type": "array", "items": { "type": "string", "maxLength": 255 } }
}
},
"blacklist": { "type": "array", "items": { "type": "string" } },
"whitelist": { "type": "array", "items": { "type": "string" } }
}
}
CampaignBody
Create and update request body. PUT requires the full body.{
"$id": "CampaignBody",
"type": "object",
"required": ["name", "mode", "pages", "filters", "domain", "alias"],
"properties": {
"name": { "type": "string", "minLength": 3, "maxLength": 255 },
"active": { "type": "boolean", "default": true },
"mode": { "enum": ["advanced", "basic"] },
"domain": { "type": ["string", "null"], "maxLength": 128 },
"alias": { "type": ["string", "null"], "maxLength": 32 },
"pages": {
"type": "object",
"required": ["white", "offers"],
"properties": {
"white": {
"type": "object",
"required": ["type", "content"],
"properties": {
"type": { "enum": ["content", "redirect", "iframe"] },
"content": { "type": "string", "maxLength": 255 }
}
},
"offers": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["type", "content", "share"],
"properties": {
"type": { "enum": ["content", "redirect", "iframe"] },
"content": { "type": "string", "maxLength": 255 },
"share": { "type": "number" },
"segmentation": {
"type": "object",
"properties": {
"country": {
"type": "array",
"maxItems": 256,
"items": { "type": "string", "pattern": "^[A-Z]{2}$" }
}
}
}
}
}
}
}
},
"filters": { "$ref": "CampaignFilters" }
}
}
CampaignFull
Single campaign response (show, create, update, clone).{
"$id": "CampaignFull",
"type": "object",
"properties": {
"id": { "type": "integer" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"name": { "type": "string" },
"active": { "type": "boolean" },
"slug": { "type": "string" },
"mode": { "enum": ["advanced", "basic"] },
"domain": { "type": ["string", "null"] },
"alias": { "type": ["string", "null"] },
"network": { "type": "string" },
"show_content_enabled": { "type": "boolean" },
"pages": { "type": "object" },
"filters": { "$ref": "CampaignFilters" },
"is_test_mode": {
"type": "boolean",
"description": "GET show only: true if client IP is in filters.whitelist"
}
}
}
CampaignShort
List item inGET /v1/campaigns response.
{
"$id": "CampaignShort",
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"active": { "type": "boolean" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"mode": { "enum": ["advanced", "basic"] },
"network": { "type": "string" },
"in_review": {
"type": "boolean",
"description": "Read-only mirror of filters.deny_always"
}
}
}
Domain
{
"$id": "Domain",
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"verified": { "type": "boolean" },
"migrated": { "type": "boolean" },
"created_at": { "type": "string", "format": "date-time" }
}
}