---
title: "Create campaign capping"
type: reference
method: POST
path: /rest-api/campaign/capping/{campaignId}.do
tag: "Capping"
---

# Create campaign capping

`POST https://YOUR-NETWORK-DOMAIN/rest-api/campaign/capping/{campaignId}.do`

Creates a new capping rule for the specified campaign, controlling how frequently events (impressions, clicks, or actions) occur within a time window. The capping type determines which event category is capped (e.g. CAMPAIGN_FREQUENCY for impressions, CAMPAIGN_CLICKS for clicks). The response JSON carries the new record, with its assigned id, under capping. Requires UPDATE permission on the campaign's advertiser, MANAGE_CAPPING_AND_LIMITATIONS enabled, and the permission of the capping type and subject.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `campaignId` | integer | yes | `2001` | Numeric ID of the campaign to add the capping rule to |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `type` | string | yes | `CAMPAIGN_FREQUENCY` | Type of the capping to create. Only campaign types are accepted: CAMPAIGN_REQUEST, CAMPAIGN_FREQUENCY, CAMPAIGN_CLICKS, CAMPAIGN_ACTIONS, CAMPAIGN_NO_CLICK, CAMPAIGN_DSP_FREQUENCY and CAMPAIGN_DSP_FREQUENCY_MONTH (period=1, periodType DAY or MONTH, flat=false), CAMPAIGN_DSP_RECENCY (amount=1, periodType MINUTE, period 1..60, flat=false). BANNER_*, PLACEMENT_* and ADVERTISER_* values are listed by the shared enum but rejected with 'Capping type is incompatible with entity' |
| `amount` | integer | yes | `1000` | Maximum number of events allowed within the specified period |
| `period` | integer | yes | `24` | Length of the capping time window, expressed in units defined by periodType |
| `periodType` | string | yes | `HOUR` | Unit of the capping period. Allowed values: SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
| `flat` | boolean | yes | `true` | When true, events are distributed evenly (flat) across the period instead of being served/counted as fast as possible |
| `subject` | string | no | `USER_COOKIE` | Entity used to identify unique users for capping. Optional; allowed values: USER_COOKIE, USER_SERVER_SIDE, USER_MIXED, IP, LES_IP |

## Responses

- `200` — Capping created: {success, capping:{id, type, amount, period, periodType, flat, subject, ...}}
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Forbidden — insufficient permissions
- `404` — Not found — resource does not exist

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/campaign/capping/2001.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'type=CAMPAIGN_FREQUENCY' \
  --data-urlencode 'amount=1000' \
  --data-urlencode 'period=24' \
  --data-urlencode 'periodType=HOUR' \
  --data-urlencode 'flat=true' \
  --data-urlencode 'subject=USER_COOKIE'
```

Source: https://epom.com/ad-server/docs/api/capping/post-campaign-capping