# Migrate from v2 to v3

> [!WARNING]
> Display \& Video 360 API v3 has sunset. Use [v4](https://developers.google.com/display-video/api/reference/rest/v4) instead.

*Last update: 2023-10-31*

## Migrate your application

Migrating from v2 to v3 requires updating your endpoint URLs to call v3 and
updating your application to account for breaking changes.

### Update your API calls from v2 to v3

To use v3 instead of v2, you need to update your requests to use new v3
endpoints.

For example, to call the [`advertisers.get`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers/get) method with v2, you would
use the following URL:

    GET https://displayvideo.googleapis.com/v2/advertisers/advertiserId

For v3, update the URL to the following:

    GET https://displayvideo.googleapis.com/v3/advertisers/advertiserId

If you are using a client library to make requests to the API, use the most
recent version of the client library and update your configuration to use v3.

### Make required changes

We're introducing a number of breaking changes in v3. Review the following
instructions and make the required changes relevant to your existing use of the
Display \& Video 360 API.

#### Update calls retrieving YouTube resources and their related targeting

- `YoutubeAdGroup` and `YoutubeAdGroupAd` resources have been replaced by [`AdGroup`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroups#AdGroup) and [`AdGroupAd`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroupAds#AdGroupAd) resources. These new resources provide nearly identical information as the v2 resources but may use updated field names or enum types. In your integration, replace your uses of `YoutubeAdGroup` or `YoutubeAdGroupAd` resources with [`AdGroup`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroups#AdGroup) and [`AdGroupAd`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroupAds#AdGroupAd) resources and update calls to the following v2 services to the corresponding v3 service:
  - `advertisers.youtubeAdGroupAds` to [`advertisers.adGroupAds`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroupAds#methods)
  - `advertisers.youtubeAdGroups` to [`advertisers.adGroups`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroups#methods)
  - `advertisers.youtubeAdGroups.targetingTypes.assignedTargetingOptions` to [`advertisers.adGroups.targetingTypes.assignedTargetingOptions`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroups.targetingTypes.assignedTargetingOptions#methods)
- References to [`YoutubeAndPartnersBiddingStrategy`](https://developers.google.com/display-video/api/reference/rest/v3/BiddingStrategy#YoutubeAndPartnersBiddingStrategy) objects have been moved to a new [`youtubeAndPartnersBid`](https://developers.google.com/display-video/api/reference/rest/v3/BiddingStrategy#FIELDS.youtube_and_partners_bid) field within the general [`BiddingStrategy`](https://developers.google.com/display-video/api/reference/rest/v3/BiddingStrategy) object. The `biddingStrategy` field has been removed from the [`YoutubeAndPartnersSettings`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.lineItems#YoutubeAndPartnersSettings)object. Update your integration to retrieve the bidding strategy for YouTube line items or ad groups from the [`BiddingStrategy`](https://developers.google.com/display-video/api/reference/rest/v3/BiddingStrategy) object in the `bidStrategy` field in the [`LineItem`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.lineItems#LineItem.FIELDS.bid_strategy) or [`AdGroup`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.adGroups#AdGroup.FIELDS.bid_strategy) resource.
- The `thirdPartyMeasurementSettings` field has been renamed to [`thirdPartyMeasurementConfigs`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.lineItems#YoutubeAndPartnersSettings.FIELDS.third_party_measurement_configs) in the [`YoutubeAndPartnersSettings`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.lineItems#YoutubeAndPartnersSettings) object and the `YoutubeAndPartnersThirdPartyMeasurementSettings` object has been renamed to [`ThirdPartyMeasurementConfigs`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.lineItems#ThirdPartyMeasurementConfigs). Update your integration to retrieve third-party measurement configuration information using the new field and object.

#### Include required billing configurations when creating advertisers

[`billingConfig`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers#Advertiser.FIELDS.billing_config) is now a required field in the
[`Advertiser`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers#Advertiser) resource. Update your [`advertisers.create`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers/create)
requests to verify that this field is set. The default billing information can
be retrieved for the parent partner through the new [`Partner`](https://developers.google.com/display-video/api/reference/rest/v3/partners#Partner)
resource [`billingConfig`](https://developers.google.com/display-video/api/reference/rest/v3/partners#Partner.FIELDS.billing_config) field.

#### Use new field to control optimized targeting

A new boolean [`enableOptimizedTargeting`](https://developers.google.com/display-video/api/reference/rest/v3/TargetingExpansionConfig#FIELDS.enable_optimized_targeting) field has replaced the
`targetingExpansionLevel` field in the [`TargetingExpansionConfig`](https://developers.google.com/display-video/api/reference/rest/v3/TargetingExpansionConfig)
object.

#### Update insertion order integration to use new KPI field

A new [`kpi`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.insertionOrders#InsertionOrder.FIELDS.kpi) field has replaced the `performanceGoal` field in
the [`InsertionOrder`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.insertionOrders#InsertionOrder) resource. This new field uses a [`Kpi`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.insertionOrders#Kpi)
object in place of the `PerformanceGoal` object and uses new fields and enums.

#### Remove references to deprecated services and fields

Various entities have been removed in v3 to align with [past feature
deprecations](https://developers.google.com/display-video/api/deprecations#features):

- The `advertisers.manualTriggers` service has been removed as [manual triggers
  have been deprecated](https://developers.google.com/display-video/api/deprecations#features.manual_triggers).
- The `billableOutcome` field has been removed from the [`InsertionOrder`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.insertionOrders#InsertionOrder) resource as [outcome based buying has been
  deprecated](https://developers.google.com/display-video/api/deprecations#features.obb).

## Additional changes

In addition to the breaking changes listed above, v3 also introduces new
features.

*Features added to v3 after the initial launch can be found in our [release
notes](https://developers.google.com/display-video/api/release-notes).*

### Proximity location list management

In v3 you can fully manage [proximity location lists](https://support.google.com/displayvideo/answer/2705812#lists), allowing you to
use the [`advertisers.locationLists.assignedLocations`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.locationLists.assignedLocations#methods) service to
create and delete locations assigned to `TARGETING_LOCATION_TYPE_PROXIMITY`
[`LocationList`](https://developers.google.com/display-video/api/reference/rest/v3/advertisers.locationLists#LocationList) resources. Locations are identified using the ID of
`TARGETING_TYPE_POI` [`TargetingOption`](https://developers.google.com/display-video/api/reference/rest/v3/targetingTypes.targetingOptions#TargetingOption) resources. These can be
retrieved using [`targetingTypes.targetingOptions.search`](https://developers.google.com/display-video/api/reference/rest/v3/targetingTypes.targetingOptions/search).

### Ability to build rule-based custom bidding algorithms

In v3, you can build and retrieve rule-based custom bidding algorithms using the
[`customBiddingAlgorithms`](https://developers.google.com/display-video/api/reference/rest/v3/customBiddingAlgorithms#methods), [`media`](https://developers.google.com/display-video/api/reference/rest/v3/media#methods),
[`customBiddingAlgorithms.rules`](https://developers.google.com/display-video/api/reference/rest/v3/customBiddingAlgorithms.rules#methods) services.

This feature is in beta and only available to allowlisted partners. If your
partner is not allowlisted, your request will return an error.