REST Resource: videoAdvertisingOptions
Stay organized with collections
Save and categorize content based on your preferences.
Resource: VideoAdvertisingOption
The advertising settings for a video. The settings identify the types of ads that can run during the video as well as the times when ads are allowed to run during the video.
AdBreak
An adBreak
resource contains information about a time when YouTube can show an in-stream advertisement during video playback.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVideoAdvertisingOption\u003c/code\u003e resource defines the types and timing of ads that can appear during a video, including third-party ads.\u003c/p\u003e\n"],["\u003cp\u003eThe available ad formats for videos are limited to \u003ccode\u003ethirdParty\u003c/code\u003e and previous ad format controls like \u003ccode\u003einstream_standard\u003c/code\u003e, \u003ccode\u003edisplay\u003c/code\u003e, \u003ccode\u003epreroll\u003c/code\u003e, and \u003ccode\u003epostroll\u003c/code\u003e should not be included in API requests.\u003c/p\u003e\n"],["\u003cp\u003eAn \u003ccode\u003eAdBreak\u003c/code\u003e specifies a moment during video playback when an in-stream advertisement can be shown, marked by the \u003ccode\u003eposition\u003c/code\u003e and \u003ccode\u003emidrollSeconds\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral methods are provided to manage video advertising settings, including retrieving, updating, patching, and getting details about the allowed ads for a video.\u003c/p\u003e\n"],["\u003cp\u003eAutomatic generation of midroll breaks can be enabled on a video by setting the field \u003ccode\u003eautoGeneratedBreaks\u003c/code\u003e to true.\u003c/p\u003e\n"]]],["This document details YouTube video advertising settings, defining `VideoAdvertisingOption` and `AdBreak`. `VideoAdvertisingOption` specifies allowed ad formats (`thirdParty`), break positions, and ad break times, including auto-generated mid-rolls. It also links to third-party ad servers with unique video IDs, targeting URLs, and parameters. `AdBreak` defines ad break positions and times (`midrollSeconds`). Methods include retrieving, patching, updating, and getting enabled ad types for a specific video.\n"],null,["# REST Resource: videoAdvertisingOptions\n\n- [Resource: VideoAdvertisingOption](#VideoAdvertisingOption)\n - [JSON representation](#VideoAdvertisingOption.SCHEMA_REPRESENTATION)\n- [AdBreak](#AdBreak)\n - [JSON representation](#AdBreak.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: VideoAdvertisingOption\n--------------------------------\n\nThe advertising settings for a video. The settings identify the types of ads that can run during the video as well as the times when ads are allowed to run during the video.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"adFormats\": [ string ], \"breakPosition\": [ string ], \"adBreaks\": [ { object (/youtube/partner/reference/rest/v1/videoAdvertisingOptions#AdBreak) } ], \"autoGeneratedBreaks\": boolean, \"id\": string, \"tpAdServerVideoId\": string, \"tpTargetingUrl\": string, \"tpUrlParameters\": string } ``` |\n\n| Fields ||\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` The type of the API resource. For this resource, the value is `youtubePartner#videoAdvertisingOption`. |\n| `adFormats[]` | `string` A list of ad formats that the video is allowed to show. Note: as of November 2023, only `thirdParty` can be enabled/disabled in this column. See [support article](https://support.google.com/youtube/thread/233723152) for more information. The following ad format controls are no longer available and should not be included in the API request: `instream_standard`, `display`, `preroll`, `postroll`. |\n| `breakPosition[]` | `string` The point at which the break occurs during the video playback. |\n| `adBreaks[]` | `object (`[AdBreak](/youtube/partner/reference/rest/v1/videoAdvertisingOptions#AdBreak)`)` A list of times when YouTube can show an in-stream advertisement during playback of the video. |\n| `autoGeneratedBreaks` | `boolean` Enables this video for automatically generated midroll breaks. If autoGeneratedBreaks is set to true on a video with adBreaks defined, our systems will identify places to show ads in addition to your manually placed ad slots. |\n| `id` | `string` The ID that YouTube uses to uniquely identify the video associated with the advertising settings. |\n| `tpAdServerVideoId` | `string` A value that uniquely identifies the video to the third-party ad server. |\n| `tpTargetingUrl` | `string` The base URL for a third-party ad server from which YouTube can retrieve in-stream ads for the video. |\n| `tpUrlParameters` | `string` A parameter string to append to the end of the request to the third-party ad server. |\n\nAdBreak\n-------\n\nAn `adBreak` resource contains information about a time when YouTube can show an in-stream advertisement during video playback.\n\n| JSON representation |\n|-----------------------------------------------------------|\n| ``` { \"position\": string, \"midrollSeconds\": integer } ``` |\n\n| Fields ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------|\n| `position` | `string` The point at which the break occurs during the video playback. |\n| `midrollSeconds` | `integer` The time of the ad break specified as the number of seconds after the start of the video when the break occurs. |\n\n| Methods ------- ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| ### [get](/youtube/partner/reference/rest/v1/videoAdvertisingOptions/get) | Retrieves advertising settings for the specified video. |\n| ### [getEnabledAds](/youtube/partner/reference/rest/v1/videoAdvertisingOptions/getEnabledAds) | Retrieves details about the types of allowed ads for a specified partner- or user-uploaded video. |\n| ### [patch](/youtube/partner/reference/rest/v1/videoAdvertisingOptions/patch) | Patches the advertising settings for the specified video. |\n| ### [update](/youtube/partner/reference/rest/v1/videoAdvertisingOptions/update) | Updates the advertising settings for the specified video. |"]]