Skip to main content

Update Segment Capping

Use this endpoint to define or adjust daily, monthly, or total capping rules for a specific segment.

Lior Avidar avatar
Written by Lior Avidar
Updated yesterday

Endpoint:
PUT /external/:campaignId/segments/:segmentId/capping

Required Header:
Authorization: Bearer YOUR_API_TOKEN


Path Parameters:

  • campaignId (Number) – The ID of the campaign that owns the segment

  • segmentId (Number) – The ID of the segment to update


Request Body Example:

{
"limitations": {
"key": "daily",
"cap": 40
}
}

Accepted Fields

Each cap object must include:

  • metric (string) – One of:
    budget, completions, clicks, impressions, notifications

  • key (string) – Defines the type of interval:

    • daily – supports all metrics

    • monthly – only budget, completions

    • total – only budget, completions

  • cap (float) – The limit value

Example Response:

{
"segmentId": 9876,
"updated": true
}

Validation Rules:

  • Values must be integers ≥ 0

  • Daily ≤ Monthly, Monthly ≤ Total

  • Lowering caps below previous usage may return an error


Possible Errors:

  • 400invalid cap: Cap value must be positive

  • 400cap hierarchy error: Daily cap exceeds monthly cap

  • 403unauthorized: Token missing or lacks write permission

  • 404not found: Segment or campaign not found

Did this answer your question?