---
title: "Update campaign piggyback"
type: reference
method: POST
path: /rest-api/piggyback/campaign/update.do
tag: "Piggybacks"
---

# Update campaign piggyback

`POST https://YOUR-NETWORK-DOMAIN/rest-api/piggyback/campaign/update.do`

Updates one or more existing piggyback tracking pixels for the specified campaign in a single batch request. Each element in the request body array is a map containing the piggyback fields to update (e.g., code/URL, type, status, sampling). The caller must have update permissions on the campaign and the Piggyback Pixel Tracking permission. Returns a JSON object with a 'success' boolean indicating whether all updates succeeded.

## Query params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `campaignId` | integer | yes | `2001` | The unique numeric identifier of the campaign whose piggyback pixels should be updated |

## Body

A JSON body. An example, built from the field definitions:

```json
[
  {}
]
```

## Responses

- `200` — Campaign piggyback updated successfully
- `400` — An invalid field (per-field errors); nothing is saved
- `401` — Unauthorized - authentication error
- `403` — Forbidden - no rights on the campaign, or the Piggyback Pixel Tracking permission is not enabled
- `404` — Campaign, site or placement not found or deleted
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/piggyback/campaign/update.do?campaignId=2001' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "id": 501,
    "active": true,
    "sampling": 50
  }
]'
```

Source: https://epom.com/ad-server/docs/api/piggybacks/post-piggyback-campaign-update