Skip to content

DSP API Examples

Introduction

Use this topic to explore practical API (application programming interface) requests for the DSP (Demand Side Platform). Here you’ll find examples for common actions like activating or deactivating a single campaign, and batch activating multiple campaigns.

What You’ll Learn

In this topic, you'll learn how to:

Update an Insertion Order

Use this endpoint to update insertion order properties such as the flight window, budget, or contract number.

Update a Flight Window

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/insertion_orders/juIGaOygS0CBBqtmXHamqA

Sample JSON Request Body

{
  "start_time": "2026-02-01T00:00:00Z",
  "end_time": "2026-02-27-01T23:59:59Z"
}

Update Impression Budget

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/insertion_orders/juIGaOygS0CBBqtmXHamqA

Sample JSON Request Body

{
  "budget_impressions": 10000
}

Batch Update Insertion Orders

Use this endpoint to update multiple insertion orders at once.

You can batch up to 100 insertion orders in a single request.

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/insertion_orders

Sample JSON Request Body

{
  "insertion_orders": [
    {
      "id": "juIGaOygS0CBBqtmXHamqA",
      "start_time": "2026-02-01T00:00:00Z",
      "end_time": "2026-02-27-01T23:59:59Z"
    },
    {
      "id": "Ug0yu240S8GS4cozKXeogw",
      "budget_impressions": 10000
    },
    {
      "id": "39ZHG9FPSSyaimG167tuxQ",
      "budget_money": {
        "currency_code": "USD",
        "units": "20000",
        "nanos": 0
      }
    }
  ]
}

Activate a Campaign

Use this endpoint to activate a campaign so it can begin serving. After activation, the campaign becomes eligible for delivery based on its configured targeting and schedule.

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns/ezdRT_lPSaS71cDBAA

Sample JSON Request Body

{
  "active": true
}

Batch Activate Campaigns

Use this endpoint to activate multiple campaigns at once. After activation, each campaign becomes eligible to deliver impressions based on its configured settings.

You can batch up to 100 Campaigns in a single request.

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns

Sample JSON Request Body

{
  "campaigns": [
    {
      "id": "H3hDnL2IQrGeW48Q_c21cA",
      "active": true
    },
    {
      "id": "i4p0R2tTSqO7t0hnB7MCmQ",
      "active": true
    },
    {
      "id": "tDu6KwF3TkOqC1cPM5jVBg",
      "active": true
    }
  ]
}

Deactivate a Campaign

Use this endpoint to disable a campaign so it can no longer serve. Deactivated campaigns retain their configuration but won't deliver impressions until reactivated.

Sample request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns/ezdRT_lPSaS71cDBAA

Sample JSON Request Body

{
  "active": false
}

Update a Campaign

Use this endpoint to update campaign properties such as the flight window, budget, CPM (cost per mile), and pacing.

Update a Flight Window

Sample request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns/Jl7cBB3mQv-H3lvSZNtZgg

Sample JSON Request Body

{
  "start_time": "2026-02-01T00:00:00Z",
  "end_time": "2026-02-27-01T23:59:59Z"
}

Update Impression Budget

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns/Jl7cBB3mQv-H3lvSZNtZgg

Sample JSON Request Body

{
  "budget_impressions": 100000
}

Update CPM

The following shows how to update the CPM to $4.50 USD.

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns/Jl7cBB3mQv-H3lvSZNtZgg

Sample JSON Request Body

{
  "cpm": {
    "currency_code": "USD",
    "units": "4",
    "nanos": 500000000
  }
}

Batch Update Campaigns

Use this endpoint to update multiple campaigns at once.

You can batch up to 100 campaigns in a single request.

Sample Request

PATCH https://platform-api.vistarmedia.com/api/dsp/v1/campaigns

Sample JSON Request Body

{
  "campaigns": [
    {
      "id": "Jl7cBB3mQv-H3lvSZNtZgg",
      "start_time": "2026-02-01T00:00:00Z",
      "end_time": "2026-02-27-01T23:59:59Z"
    },
    {
      "id": "KrkeGfXQS-6xI5JVd5xgkw",
      "cpm": {
        "currency_code": "USD",
        "units": "4",
        "nanos": 500000000
      }
    },
    {
      "id": "nxrhjahwR4WldijV17K8bQ",
      "cpm": {
        "currency_code": "USD",
        "units": "10",
        "nanos": 0
      }
    }
  ]
}

More Resources

To learn more about this topic, see: