---
title: "Update capping by ID"
type: reference
method: POST
path: /rest-api/capping/{cappingId}.do
tag: "Capping"
---

# Update capping by ID

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

Edits one capping rule of an advertiser, campaign, banner or placement - the id from that entity's capping list. Updates an existing capping object identified by its numeric ID, replacing its amount, period, period type, flat distribution flag, and optionally its subject type. The capping type must match the type of the existing record (e.g. CAMPAIGN_FREQUENCY, BANNER_CLICKS). All required fields must be provided; partial updates are not supported by this endpoint. Requires UPDATE permission on the advertiser, campaign, banner or placement the capping belongs to, and the permission of the capping type and subject. Writes also need the section permission enabled: MANAGE_INVENTORY_CAPPING for a placement capping, MANAGE_CAPPING_AND_LIMITATIONS for the others.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `cappingId` | integer | yes | `501` | Numeric ID of the capping record to update |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `type` | string | yes | `CAMPAIGN_FREQUENCY` | Type of the capping record. Allowed values: CAMPAIGN_REQUEST, CAMPAIGN_FREQUENCY, CAMPAIGN_CLICKS, CAMPAIGN_ACTIONS, BANNER_REQUEST, BANNER_FREQUENCY, BANNER_CLICKS, BANNER_ACTIONS, PLACEMENT_REQUEST, PLACEMENT_FREQUENCY, PLACEMENT_CLICKS, PLACEMENT_ACTIONS, ADVERTISER_FREQUENCY |
| `amount` | integer | yes | `1000` | Maximum number of events (impressions, clicks, or actions) 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 updated successfully
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — The caller may not change the entity the capping belongs to
- `404` — No capping of this type has this id, or the entity it belongs to is deleted

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/capping/501.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-capping