Endpoint:
PUT /external/campaigns/:campaignId/capping
Required Header:
Authorization: Bearer YOUR_API_TOKEN
Path Parameter:
campaignId(Number) – The ID of the campaign to update
Request Body Example:
{
"rules": [
{
"metric": "budget",
"key": "daily",
"cap": 250.0
},
{
"metric": "completions",
"key": "monthly",
"cap": 1200
},
{
"metric": "total",
"key": "start_end",
"startDate": "01-07-2025",
"endDate": "31-07-2025"
}
]
}
Accepted Fields
Each cap object must include:
metric(string) – One of:
budget,completions,clicks,impressions,notificationskey(string) – Defines the type of interval:daily– supports all metricsmonthly– onlybudget,completionstotal– onlybudget,completionsstart_end– sets a time window for applying a total cap (must be used withmetric: totalonly)
cap(float) – The limit value
When using key: start_end, also include:
startDate(string, format: DD-MM-YYYY)endDate(string, format: DD-MM-YYYY)metric= totalonly
⚠️ start_end is not a calssic cap type — it defines a date range for the campaign
Example Response:
{
campaignId: number
}Validation Rules:
startDate:Must be a valid date in ISO 8601 format
Must start at or after current date
endDate:Must be a valid date in ISO 8601 format
Must be after startDate
Possible Errors:
400 – invalid metric: Metric is not supported
400 – invalid key: Key is not allowed for the given metric
400 – missing field: Required fieldcapis missing
400 – invalid date format: Dates must follow DD-MM-YYYY format
400 – missing date range:startDateandendDateare required when using keystart_end
400 – bad request – startDate: The start date cannot be earlier than today
400 – bad request – endDate: The end date cannot be earlier than today
403 – unauthorized: Missing or invalid permissions
404 – not found: The specified campaign ID does not exist