The Dynamic Ad Insertion API lets you request and track DAI livestreams.

## Service: dai.google.com

All URIs are relative to `https://dai.google.com`.

## Method: stream

| Methods ||
|---|---|
| `stream` | `POST /ssai/pods/api/v1/network/{network_code}/custom_asset/{custom_asset_key}/stream` Registers a DAI pod serving livestream session. |

### HTTP request

    POST https://dai.google.com/ssai/pods/api/v1/network/{network_code}/custom_asset/{custom_asset_key}/stream

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated this event in Google Ad Manager. |

### Request body

The request body is of type `application/x-www-form-urlencoded` and contains the
following parameters:

| Parameters |||
|---|---|---|
| **DFP Targeting Parameters** | Optional | [Additional targeting parameters.](https://support.google.com/admanager/answer/7320899) |
| **Override Stream Parameters** | Optional | [Override default values of a stream creation parameter.](https://support.google.com/dfp_premium/answer/7320898) |
| **HMAC Authentication** | Optional | [Authenticate using an HMAC-based token.](https://support.google.com/dfp_premium/answer/7637490) |

### Response body

If successful, the response body contains a new [`Stream`](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#stream) object.

### Open Measurement

The DAI API contains information for Open Measurement verification in the
[`Verifications`](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#verifications) field. This field contains one or more
`Verification` elements that list the resources and metadata required to execute
third-party measurement code in order to verify creative playback. Only
`JavaScriptResource` is supported. For more information, see the
[IAB Tech Lab](https://iabtechlab.com/standards/open-measurement-sdk/) and the
[VAST 4.1 spec](https://iabtechlab.com/wp-content/uploads/2018/06/VAST4.1-June7-FINAL.pdf).

## Method: pod segment

| Methods ||
|---|---|
| `pod segment` | `GET /linear/pods/v1/seg/network/{network_code}/custom_asset/{custom_asset_key}/{pod_identifier}/profile/{profile_name}/{segment_number}.{segment_format}` Creates a DAI stream for the given event ID. |

### HTTP request

    GET https://dai.google.com/linear/pods/v1/seg/network/{network_code}/custom_asset/{custom_asset_key}/{pod_identifier}/profile/{profile_name}/{segment_number}.{segment_format}

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated this event in Google Ad Manager. |
| `pod_identifier` | The following formats are supported: `pod/{integer}` The numeric identifier for the current ad break. Ad pod IDs are assigned incrementally for each ad break event, starting at `1`. `ad_break_id/{string}` The string identifier for the current ad break. Any unknown Ad Break ID provided to that endpoint creates a new Ad Break for the livestream event. The following restrictions apply to custom adbreak IDs: - Must be between 1 and 63 characters long - Must contain only lowercase letters, digits, and hyphens. > [!IMPORTANT] > **Important:** `pod_identifier` must be of the same format and value for all users viewing the same ad break in the livestream event. The segment requests must use the same `pod_identifier` format throughout the lifetime of a livestream event. |
| `profile_name` | `string` The [name](https://developers.google.com/ad-manager/api/reference/latest/DaiEncodingProfileService.DaiEncodingProfile#name) of the requested [Google Ad Manager DAI encoding profile](https://developers.google.com/ad-manager/api/reference/latest/DaiEncodingProfileService.DaiEncodingProfile). The encoding profile must be one of the configured encoding profiles for the selected event. |
| `segment_number` | `integer` The index of the requested segment within the current ad pod, starting at zero. > [!IMPORTANT] > **Important:** When using an MP4 container, the initialization segment can be requested by setting `segment_number` to `init`. |
| `segment_format` | `string` The file extension associated with the requested segment format. Accepted extensions are: `ts`, `mp4`, `vtt`, `aac`, `ac3` or `eac3`. |

### Query parameters

Parameters `stream_id` **required** `string`

The stream ID for the current user's session. This value is returned by
a successful request to the `stream` endpoint.
`sd` `required^[1](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#pod_segment_footnote_1 "(except for initialization segments)")^` `integer`

The duration of the requested segment, in milliseconds.
`so` **optional** The offset of the requested segment within the ad pod, in milliseconds.
If you omit the `so` parameter, it will be calculated by
multiplying the segment duration by the segment number.
`pd` **required^[2](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#pod_segment_footnote_2 "(except for events with durationless ad breaks enabled)")^** `integer`

The duration of the ad pod, in milliseconds.
`auth-token` **required** `string`

The `auth-token` consists of an encoded
[HMAC token](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/live/token)
with the following data:

- `pod_id` or `ad_break_id`
- `network_code`
- `custom_asset_key`
- `cust_params`
- `pd`
- `scte35`
- `exp`
`last` **optional** `boolean`

Indicates the last segment in the ad break. Omit this parameter for all
other segments.
`scte35` **optional** `string`

Base64-encoded SCTE-35signal for this ad break.
`cust_params` **optional** `string`


A set of key-value pairs, used for Ad Manager campaign targeting. These
pairs must be represented as a url-encoded query string.
**Example:** Parameters
- **section** = `sports`
- **page** = `golf,tennis`
`Request URL` `...&cust_params=section%3Dsports%26page%3Dgolf%2Ctennis...`

#### Footnotes

1. **`sd`** is not required for initialization segments. [↩](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#pod_segment_reference_1 "Jump back to footnote 1 in the text.")
2. **`pd`** is not required for events with durationless ad breaks enabled. [↩](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#pod_segment_reference_2 "Jump back to footnote 2 in the text.")

### Example

GET https://dai.google.com/linear/pods/v1/seg/network/sandbox_dev/custom_asset/podserving-segredirect-custom-key/ad_break_id/adbreak-2/profile/8b8888cf79ad43f0800482ffc035a1ac_ts_a/1.ts?so=0\&sd=10000\&pd=30000\&stream_id=8e19cbc6-850b-404c-99d7-860aa4a674cb:TEST

GET https://dai.google.com/linear/pods/v1/seg/network/sandbox_dev/custom_asset/podserving-segredirect-custom-key/pod/2/profile/8b8888cf79ad43f0800482ffc035a1ac_ts_a/1.ts?so=0\&sd=10000\&pd=30000\&stream_id=8e19cbc6-850b-404c-99d7-860aa4a674cb:TEST

### Response body

If successful, the response body will be a playable stream segment matching the
format and parameters specified in the request.

## Method: HLS pod manifest

Retrieves an HLS ad pod manifest of a livestream that is ready for a client
video player to load and play.

| Methods ||
|---|---|
| `GET` | `GET /linear/pods/v1/hls/network/{network_code}/custom_asset/{custom_asset}/{pod_identifier}.m3u8;` API to retrieve an HLS multivariant playlist for an ad pod. |

### HTTP request

    GET https://dai.google.com/linear/pods/v1/hls/network/{network_code}/custom_asset/{custom_asset_key}/{pod_identifier}.m3u8?stream_id={stream_id}&pd={pod_duration}

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated this event in Google Ad Manager |
| `pod_identifier` | The following formats are supported: `pod/{integer}` The numeric identifier for the current ad break. Ad pod IDs are assigned incrementally for each ad break event, starting at `1`. `ad_break_id/{string}` The string identifier for the current ad break. Any unknown Ad Break ID provided to that endpoint creates a new Ad Break for the livestream event. The following restrictions apply to custom adbreak IDs: - Must be between 1 and 63 characters long - Must contain only lowercase letters, digits, and hyphens. > [!IMPORTANT] > **Important:** `pod_identifier` must be of the same format and value for all users viewing the same ad break in the livestream event. The manifest requests must use the same `pod_identifier` format throughout the lifetime of a livestream event. |

### Query parameters

Parameters `stream_id` **Required** `string`

The stream ID for the current user's session. This value is returned
by a successful request to the `stream` endpoint.
`pd` **Required** `integer`

The duration of the ad pod, in milliseconds.
`scte35` **optional** `string`

Base64-encoded SCTE-35signal for this ad break.
`cust_params` **optional** `string`


A set of key-value pairs, used for Ad Manager campaign targeting. These
pairs must be represented as a url-encoded query string.
**Example:** Parameters
- **section** = `sports`
- **page** = `golf,tennis`
`Request URL` `...&cust_params=section%3Dsports%26page%3Dgolf%2Ctennis...` `auth-token` **required** `string`

The `auth-token` consists of an encoded
[HMAC token](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/live/token)
with the following data:

- `pod_id` or `ad_break_id`
- `network_code`
- `custom_asset_key`
- `cust_params`
- `pd`
- `scte35`
- `exp`

### Response body

If successful, the response body is an HLS multivariant playlist.

## Method: DASH pod manifest

Retrieves an MPEG-DASH ad pod manifest of a livestream that is ready for a
client video player to load and play.

| Methods ||
|---|---|
| `GET` | `GET /linear/pods/v1/dash/network/{network_code}/custom_asset/{custom_asset}/stream/{stream_id}/{pod_identifier}/manifest.mpd` API to retrieve an MPEG-DASH mpd playlist for an ad pod. |

### HTTP request

    GET https://dai.google.com/linear/pods/v1/dash/network/{network_code}/custom_asset/{custom_asset_key}/stream/{stream_id}/pod/{pod_id}/manifest.mpd?pd={pod_duration}

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated this event in Google Ad Manager |
| `stream_id` | `string` The stream ID for the current user's session. This value is returned by a successful request to the `stream` endpoint. |
| `pod_identifier` | The following formats are supported: `pod/{integer}` The numeric identifier for the current ad break. Ad pod IDs are assigned incrementally for each ad break event, starting at `1`. `ad_break_id/{string}` The string identifier for the current ad break. Any unknown Ad Break ID provided to that endpoint creates a new Ad Break for the livestream event. The following restrictions apply to custom adbreak IDs: - Must be between 1 and 63 characters long - Must contain only lowercase letters, digits, and hyphens. > [!IMPORTANT] > **Important:** `pod_identifier` must be of the same format and value for all users viewing the same ad break in the livestream event. The manifest requests must use the same `pod_identifier` format throughout the lifetime of a livestream event. |

### Query parameters

Parameters `pd` **Required** `integer`

The duration of the ad pod, in milliseconds.
`scte35` **optional** `string`

Base64-encoded SCTE-35signal for this ad break.
`cust_params` **optional** `string`


A set of key-value pairs, used for Ad Manager campaign targeting. These
pairs must be represented as a url-encoded query string.
**Example:** Parameters
- **section** = `sports`
- **page** = `golf,tennis`
`Request URL` `...&cust_params=section%3Dsports%26page%3Dgolf%2Ctennis...` `auth-token` **required** `string`

The `auth-token` consists of an encoded
[HMAC token](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/live/token)
with the following data:

- `pod_id` or `ad_break_id`
- `network_code`
- `custom_asset_key`
- `cust_params`
- `pd`
- `scte35`
- `exp`

### Response body

If successful, the response body is an MPEG-DASH mpd playlist.

## Method: DASH pod period template

| Methods ||
|---|---|
| `pods` | `GET /linear/pods/v1/dash/network/{network_code}/custom_asset/{custom_asset_key}/pods.json` Requests a DASH period template from Google Ad Manager. This template contains macros that you must populate with your stream parameters. Once these macros are populated, the template becomes your ad break period, and can be stitched into your DASH manifest. > [!IMPORTANT] > **Important:** Only request this template once per stream session, then cache it for reuse with each ad break. |

### HTTP request

    GET https://dai.google.com/linear/pods/v1/dash/network/{network_code}/custom_asset/{custom_asset_key}/pods.json

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated this event in Google Ad Manager. |

### Query parameters

| Parameters |||
|---|---|---|
| `stream_id` | **required** | `string` The stream ID for the current user's session. This value is returned by a successful request to the `stream` endpoint. |
| `tv` | **optional** | `integer` The template version. Defaults to `0`. Specifies the pod template version to return. - `0`: Requests a template that uses pod sequence identifier. - `1`: Requests a template that supports both pod sequence and ad break identifiers. |

### Response body

If successful, the response body contains a new
[`PodTemplateResponse`](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#PodTemplateResponse) object.

## Method: Ad pod timing metadata

| Methods ||
|---|---|
| `ad pod timing metadata` | `GET /linear/pods/v1/adv/network/{network_code}/custom_asset/{custom_asset_key}/pod.json` Retrieves ad pod timing metadata. |

### HTTP request

    GET https://dai.google.com/linear/pods/v1/adv/network/{network_code}/custom_asset/{custom_asset_key}/pod.json

### Path parameters

| Parameters ||
|---|---|
| `network_code` | `string` The publisher's Google Ad Manager network code. |
| `custom_asset_key` | `string` The custom identifier associated with this livestream in Google Ad Manager. |

### Query parameters

| Parameters |||
|---|---|---|
| `stream_id` | **Required** | `string` The Ad Manager stream ID from the client video player app. |
| `ad_break_id` | **required** | `string` The next upcoming ad break ID. Ad break IDs are provided by the Stitching server or VTP, and must match across early ad break notifications, ad pod timing metadata requests, and segment redirect requests for the same ad break. The following restrictions apply to custom adbreak IDs: - Must be between 1 and 63 characters long - Must contain only lowercase letters, digits, and hyphens. - The ad break id `preroll` is reserved to retrieve the preroll ad pod. It cannot be used to identify any other ad pod. |
| `auth-token` | **required** | `string` The `auth-token` consists of an encoded [HMAC token](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/live/token) with the following data: - `ad_break_id` - `network_code` - `custom_asset_key` - `cust_params` - `pd` - `scte35` - `exp` |
| `timeout` | **optional** | `integer` The number of milliseconds that DAI can block this request to wait for ad decisioning. Use this parameter on requests that must return populated ads on the first request, such as pre-roll ad breaks. If timeout is exceeded, the request returns a status of pending. If included, the timeout value must be between 1000 and 15000 milliseconds. If omitted, responses are not delayed to wait for ad decisioning. |
| `final` | **optional** | `boolean` Set to `true` to indicate to DAI that this is the last request the VTP is willing to make for this ad pod. If an ad decision isn't available yet (by the optional timeout), DAI will return slate permanently for this request. Defaults to `false`. |
| #### Ad decisioning parameters > [!NOTE] > **Note:** Send the same values for these parameters in each request that contains the same ad break ID. If you omit or change these values in subsequent requests, Google Ad Manager will ignore the changed variables and use only the values received on the initial request. |||
| `pd` | **optional** | `integer` The duration of the ad break (in milliseconds). Also referred to as ad pod duration. > [!IMPORTANT] > **Important:** This value is only optional if the [default ad break duration value](https://support.google.com/admanager/answer/1080597) has been configured in the Ad Manager UI. If neither value has been set, the request will result in a `400` error. If EABN is used, the pd value must match the duration provided in your ad break notification. If the durations don't match, the EABN value will be given priority. |
| `cust_params` | **optional** | `string` Custom parameters for ad break targeting, as described in the [Ad Manager Help Center](https://support.google.com/admanager/answer/1080597). |
| `scte35` | **optional** | `string` A base64-encoded SCTE-35 signal. If the signal is invalid, a message will be sent in the `X-Ad-Manager-Dai-Warning` HTTP header of the response and the request will be sent without the invalid scte35 value. |

### Response body

If successful, the response body contains a new
[`AdPodTimingMetadataResponse`](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#adpodtimingmetadataresponse) object.

## Method: media verification

After encountering an ad media identifier during playback, immediately make a
request using the **media_verification_url** obtained from the **stream**
endpoint, above. These requests aren't necessary for server-side-beaconing
streams, where the server initiates media verification.

Requests to the `media verification` endpoint are idempotent.

| Methods ||
|---|---|
| `media verification` | `GET /{media_verification_url}/{ad_media_id}` Notifies the API of a media verification event. |

> [!NOTE]
> **Note:** Don't send `progress` ID3 events to this endpoint. `progress` events are intended to help publishers differentiate playback within and outside of an ad break, and serve no other ad tracking purposes. Publishers can identify progress events by searching the metadata json file for the media identifier and verifying that the **type** field is set to `progress`.

### HTTP request

    GET https://{media-verification-url}/{ad-media-id}

### Response body

`media verification`
returns the following responses:

- `HTTP/1.1 204 No Content` if media verification succeeds and all pings are sent.
- `HTTP/1.1 404 Not Found` if the request can't verify the media due to incorrect URL formatting or expiration.
- `HTTP/1.1 404 Not Found` if a previous verification request for this ID succeeded.
- `HTTP/1.1 409 Conflict` if another request is already sending pings at this time.

### Ad media IDs

Ad media identifiers will be encoded in a separate metadata track --- timed
metadata for HLS transport stream, or emsg for mp4 files. Ad media identifiers
will always begin with the string `google_`.

The entire text contents of the metadata entry should be appended to the ad
verification URL prior to making each ad verification request.

## Method: metadata

The metadata endpoint at `metadata_url` returns information used to build an ad
UI. The metadata endpoint isn't available for server-side-beaconing streams,
where the server is responsible for initiating ad media verification.

| Methods ||
|---|---|
| `metadata` | `GET /{metadata_url}/{ad-media-id}` `GET /{metadata_url}` Retrieves ad metadata information. |

> [!NOTE]
> **Note:** It is recommended you provide the ad media ID to the endpoint. Otherwise, use `polling_frequency` to determine how often to connect to this endpoint.

### HTTP request

    GET https://{metadata_url}/{ad-media-id}

    GET https://{metadata_url}

### Query parameters

| Parameters |||
|---|---|---|
| `delta_token` | **optional** | `string` An opaque token representing the client's current synchronization state. If provided, the server returns only the metadata that has changed since the token was generated, along with a new `next_delta_token` in the response. If omitted, the server returns the full metadata for the entire DVR window. |

### Response body

If successful, the response returns an instance of
[`PodMetadata`](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#podmetadata).

### Parsing Metadata

Metadata has three discrete sections: `tags`, `ads`, and ad `breaks`. The entry
point into the data is the `tags` section. From there, iterate through the tags
and find the first entry whose name is a prefix for the
[ad media ID](https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#ad_media_ids_hls) found in the video stream. For example, you
might have an ad media ID that looks like:

    google_1234567890

Then you find a tag object named `google_12345`. In this case, it matches your
ad media id. Once you find the correct ad media prefix object, you can look up
ad ids, ad break ids, and the event type. Ad ids are then used to index the
`ads` objects and ad break ids are used to index the `breaks` objects.

## API Objects

### Stream

Stream is used to render a list of resources for a newly created stream in JSON format.

| JSON representation |
|---|
| ``` { "stream_id": string, "media_verification_url": string, "metadata_url": string, "session_update_url": string, "heartbeat_url": string, "polling_frequency": number, "pod_manifest_url": string, "manifest_format": string, } ``` |

| Fields ||
|---|---|
| `stream_id` | `string` The GAM stream identifier. |
| `media_verification_url` | `string` The media verification URL used as base endpoint for tracking playback events. |
| `metadata_url` | `string` Metadata URL used to poll for periodic information about upcoming stream ad events. |
| `session_update_url` | `string` The session's update URL used to update the targeting parameters for this stream. The original values for the targeting parameters are captured during the initial stream create request. |
| `heartbeat_url` | `string` The heartbeat URL, used to keep the server side beaconing stream alive, it must be pinged every {PollingFrequency} seconds. Populated for server side beaconing streams. |
| `polling_frequency` | `number` The polling frequency, in seconds, when requesting metadata_url or heartbeat_url. |
| `pod_manifest_url` | `string` The pod manifest URL template is used to generate the URL to retrieve a stream's pod manifest, corresponding to the URL of the multivariant playlist in HLS or the MPD in DASH. Populated for Livestream events of Dynamic Ad Insertion type POD_SERVING_MANIFEST. https://developers.google.com/ad-manager/api/reference/v202305/LiveStreamEventService.DynamicAdInsertionType |
| `manifest_format` | `string` Manifest format is the format of the manifest retrieved from pod_manifest_url, either dash or hls. |

### PodMetadata

PodMetadata contains metadata information on ads, ad breaks, and media ID tags.

| JSON representation |
|---|
| ``` { "tags": map[string, object(TagSegment)], "ads": map[string, object(Ad)], "ad_breaks": map[string, object(AdBreak)], "next_delta_token": string, "obsolete_ad_break_ids": [], } ``` |

| Fields ||
|---|---|
| `tags` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#tagsegment` Map of tag segments indexed by tag prefix. |
| `ads` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#ad` Map of ads indexed by ad ID. |
| `ad_breaks` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#adbreak` Map of ad breaks indexed by ad break ID. |
| `next_delta_token` | `string` An opaque token for the client to use on the next poll. |
| `obsolete_ad_break_ids` | `string` A list of ad break IDs that are obsolete and should be removed from the client's cache. |

### TagSegment

TagSegment contains a reference to an ad, its ad break, and event type. TagSegment with type="progress" should not be pinged to the ad media verification endpoint.

| JSON representation |
|---|
| ``` { "ad": string, "ad_break_id": string, "type": string, } ``` |

| Fields ||
|---|---|
| `ad` | `string` The ID of this tag's ad. |
| `ad_break_id` | `string` The ID of this tag's ad break. |
| `type` | `string` This tag's event type. |

### AdBreak

AdBreak describes a single ad break in the stream. It contains a duration, a type (mid/pre/post) and the number of ads.

| JSON representation |
|---|
| ``` { "type": string, "duration": number, "expected_duration": number, "ads": number, } ``` |

| Fields ||
|---|---|
| `type` | `string` Valid break types are: pre, mid, and post. |
| `duration` | `number` Total ad duration for this ad break, in seconds. |
| `expected_duration` | `number` Expected duration of the ad break (in seconds), including all ads and any slate. |
| `ads` | `number` Number of ads in the ad break. |

### Ad

Ad describes an ad in the stream.

| JSON representation |
|---|
| ``` { "ad_break_id": string, "position": number, "duration": number, "title": string, "description": string, "advertiser": string, "ad_system": string, "ad_id": string, "creative_id": string, "creative_ad_id": string, "deal_id": string, "clickthrough_url": string, "click_tracking_urls": [], "verifications": [object(Verification)], "slate": boolean, "icons": [object(Icon)], "wrappers": [object(Wrapper)], "universal_ad_id": object(UniversalAdID), "extensions": [], "companions": [object(Companion)], "interactive_file": object(InteractiveFile), } ``` |

| Fields ||
|---|---|
| `ad_break_id` | `string` The ID of this ad's ad break. |
| `position` | `number` Position of this ad in the ad break, starting at 1. |
| `duration` | `number` Duration of the ad, in seconds. |
| `title` | `string` Optional title of the ad. |
| `description` | `string` Optional description of the ad. |
| `advertiser` | `string` Optional advertiser identifier. |
| `ad_system` | `string` Optional ad system. |
| `ad_id` | `string` Optional ad ID. |
| `creative_id` | `string` Optional creative ID. |
| `creative_ad_id` | `string` Optional creative ad ID. |
| `deal_id` | `string` Optional deal ID. |
| `clickthrough_url` | `string` Optional clickthrough URL. |
| `click_tracking_urls` | `string` Optional click tracking URLs. |
| `verifications` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#verification` Optional Open Measurement verification entries which list the resources and metadata required to execute third-party measurement code to verify creative playback. |
| `slate` | `boolean` Optional bool indicating the current entry is slate. |
| `icons` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#icon` A list of icons, omitted if empty. |
| `wrappers` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#wrapper` A list of Wrappers, omitted if empty. |
| `universal_ad_id` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#universaladid` Optional universal ad ID. |
| `extensions` | `string` Optional list of all \<Extension\> nodes in the VAST. |
| `companions` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#companion` Optional companions that may be displayed along with this ad. |
| `interactive_file` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#interactivefile` Optional interactive creative (SIMID) that should be displayed during ad playback. |

### PodTemplateResponse

PodTemplateResponse represents the JSON payload returned to a VTP for pod stitching.

| JSON representation |
|---|
| ``` { "dash_period_template": string, "segment_duration_ms": int64, } ``` |

| Fields ||
|---|---|
| `dash_period_template` | `string` DashPeriodTemplate is the xml template for the period to be filled with appropriate data before stitching. |
| `segment_duration_ms` | `int64` SegmentDurationMS is the duration of the period segments in milliseconds. |

### AdpodTimingMetadataResponse

AdpodTimingMetadataResponse contains information about the Ad Pod and how to build segment URLs for it.

| JSON representation |
|---|
| ``` { "status": string, "ads": [object(AdRendering)], "slate": object(SlateRendering), "dash_representations": map[string, object(DASHRepresentation)], "dash_adaptation_sets": map[string, object(DASHAdaptationSet)], } ``` |

| Fields ||
|---|---|
| `status` | `string` Decision status for the ad pod. |
| `ads` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#adrendering` Array of Ad objects describing how to render the ad segment urls, indexed starting at 0. |
| `slate` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#slaterendering` Slate describing how to render the slate segment urls. |
| `dash_representations` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#dashrepresentation` List of DASH Representations for that ad pod to be rendered in DASH manifests. |
| `dash_adaptation_sets` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#dashadaptationset` List of DASH Adaptation Sets for that ad pod to be rendered in DASH manifests. |

### AdRendering

AdRendering describes how to render a decisioned ad.

| JSON representation |
|---|
| ``` { "duration_ms": number, "variants": map[string, object(VariantRendering)], } ``` |

| Fields ||
|---|---|
| `duration_ms` | `number` Duration of the ad, in milliseconds (int). |
| `variants` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#variantrendering` Dictionary of Variant objects (see below), indexed by the variant/profile ID, as configured from the UI. |

### SlateRendering

SlateRendering describes how to render slate content.

| JSON representation |
|---|
| ``` { "duration_ms": number, "variants": map[string, object(VariantRendering)], } ``` |

| Fields ||
|---|---|
| `duration_ms` | `number` Duration of the slate, in milliseconds (int). |
| `variants` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#variantrendering` Dictionary of Variant objects, indexed by variant/profile ID. Slate durations must be looped until the required slate length is reached, inserting HLS discontinuities between iterations, or looping new periods for MPEG-DASH. |

### VariantRendering

VariantRendering describes one variant/profile within the ad/slate.

| JSON representation |
|---|
| ``` { "segment_extension": string, "segment_durations": object(SegmentDurations), } ``` |

| Fields ||
|---|---|
| `segment_extension` | `string` String, one of: ts, mp4, aac, ac3, ec3, m4a, m4v. Filename extension part of the segment URLs. |
| `segment_durations` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#segmentdurations` SegmentDurations objects. Each segment duration can be translated into a segment URL. |

### SegmentDurations

SegmentDurations describes the duration of a sequence of segments, in a specified time unit.

| JSON representation |
|---|
| ``` { "timescale": number, "values": [], } ``` |

| Fields ||
|---|---|
| `timescale` | `number` Timescale is the number of units per second (int) Expected to be: 1000 for HLS (milliseconds) 90000 for DASH video (PTS) Audio sample rate for DASH audio. |
| `values` | `number` Array of int segment durations, in timescale units. |

### DASHRepresentation

DASHRepresentation describes Representation nodes to be rendered in DASH manifests.

| JSON representation |
|---|
| ``` { "codecs": string, "bandwidth": number, "width": number, "height": number, "frame_rate": string, "audio_sampling_rate": number, "audio_channel_config": object(SchemeIDURIAndValue), } ``` |

| Fields ||
|---|---|
| `codecs` | `string` Codecs of the representation. |
| `bandwidth` | `number` Bandwidth of the representation. |
| `width` | `number` Width of the representation. |
| `height` | `number` Height of the representation. |
| `frame_rate` | `string` Frame rate of the representation. |
| `audio_sampling_rate` | `number` Audio sampling rate of the representation. |
| `audio_channel_config` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#schemeiduriandvalue` Audio channel configuration of the representation. |

### DASHAdaptationSet

DASHAdaptationSet describes AdaptationSet nodes to be rendered in DASH manifests.

| JSON representation |
|---|
| ``` { "content_type": string, "mime_type": string, "role": object(SchemeIDURIAndValue), "inband_event_stream": object(SchemeIDURIAndValue), "min_frame_rate": string, "max_frame_rate": string, "scan_type": string, "start_with_sap": string, "segment_alignment": boolean, "representations": [], } ``` |

| Fields ||
|---|---|
| `content_type` | `string` Content type of the adaptation set. |
| `mime_type` | `string` MIME type of the adaptation set. |
| `role` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#schemeiduriandvalue` Role of the adaptation set. |
| `inband_event_stream` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#schemeiduriandvalue` Inband event stream of the adaptation set. |
| `min_frame_rate` | `string` Minimum frame rate of the adaptation set. |
| `max_frame_rate` | `string` Maximum frame rate of the adaptation set. |
| `scan_type` | `string` Scan type of the adaptation set. |
| `start_with_sap` | `string` Start with SAP of the adaptation set. |
| `segment_alignment` | `boolean` Segment alignment of the adaptation set. |
| `representations` | `string` Representations of the adaptation set. |

### SchemeIDURIAndValue

SchemeIDURIAndValue is a pair of a scheme ID and its value.

| JSON representation |
|---|
| ``` { "scheme_id_uri": string, "value": string, } ``` |

| Fields ||
|---|---|
| `scheme_id_uri` | `string` Scheme ID URI of the value. |
| `value` | `string` Value of the scheme ID URI. |

### Icon

Icon contains information about a VAST Icon.

| JSON representation |
|---|
| ``` { "click_data": object(ClickData), "creative_type": string, "click_fallback_images": [object(FallbackImage)], "height": int32, "width": int32, "resource": string, "type": string, "x_position": string, "y_position": string, "program": string, "alt_text": string, } ``` |

| Fields ||
|---|---|
| `click_data` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#clickdata` |
| `creative_type` | `string` |
| `click_fallback_images` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#fallbackimage` |
| `height` | `int32` |
| `width` | `int32` |
| `resource` | `string` |
| `type` | `string` |
| `x_position` | `string` |
| `y_position` | `string` |
| `program` | `string` |
| `alt_text` | `string` |

### ClickData

ClickData contains information about an icon clickthrough.

| JSON representation |
|---|
| ``` { "url": string, } ``` |

| Fields ||
|---|---|
| `url` | `string` |

### FallbackImage

FallbackImage contains information about a VAST fallback image.

| JSON representation |
|---|
| ``` { "creative_type": string, "height": int32, "width": int32, "resource": string, "alt_text": string, } ``` |

| Fields ||
|---|---|
| `creative_type` | `string` |
| `height` | `int32` |
| `width` | `int32` |
| `resource` | `string` |
| `alt_text` | `string` |

### Wrapper

Wrapper contains information about a wrapper ad. It does not include a Deal ID if it does not exist.

| JSON representation |
|---|
| ``` { "system": string, "ad_id": string, "creative_id": string, "creative_ad_id": string, "deal_id": string, } ``` |

| Fields ||
|---|---|
| `system` | `string` Ad system identifier. |
| `ad_id` | `string` Ad ID used for the wrapper ad. |
| `creative_id` | `string` Creative ID used for the wrapper ad. |
| `creative_ad_id` | `string` Creative Ad ID used for the wrapper ad. |
| `deal_id` | `string` Optional deal ID for the wrapper ad. |

### Verification

Verification contains information for Open Measurement, which facilitates third-party viewability and verification measurement. Currently, only JavaScript resources are supported. See https://iabtechlab.com/standards/open-measurement-sdk/

| JSON representation |
|---|
| ``` { "vendor": string, "java_script_resources": [object(JavaScriptResource)], "tracking_events": [object(TrackingEvent)], "parameters": string, } ``` |

| Fields ||
|---|---|
| `vendor` | `string` The verification vendor. |
| `java_script_resources` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#javascriptresource` List of JavaScript resources for the verification. |
| `tracking_events` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#trackingevent` List of tracking events for the verification. |
| `parameters` | `string` An opaque string passed to bootstrap verification code. |

### JavaScriptResource

JavaScriptResource contains information for verification via JavaScript.

| JSON representation |
|---|
| ``` { "script_url": string, "api_framework": string, "browser_optional": boolean, } ``` |

| Fields ||
|---|---|
| `script_url` | `string` URI to javascript payload. |
| `api_framework` | `string` APIFramework is the name of the video framework exercising the verification code. |
| `browser_optional` | `boolean` Whether this script can be run outside of a browser. |

### TrackingEvent

TrackingEvent contains URLs that should be pinged by the client in certain situations.

| JSON representation |
|---|
| ``` { "event": string, "uri": string, } ``` |

| Fields ||
|---|---|
| `event` | `string` The type of the tracking event. |
| `uri` | `string` The tracking event to be pinged. |

### UniversalAdID

UniversalAdID is used to provide a unique creative identifier that is maintained across ad systems.

| JSON representation |
|---|
| ``` { "id_value": string, "id_registry": string, } ``` |

| Fields ||
|---|---|
| `id_value` | `string` The Universal Ad ID of the selected creative for the ad. |
| `id_registry` | `string` A string used to identify the URL for the registry website where the selected creative's Universal Ad ID is cataloged. |

### Companion

Companion contains information for companion ads that may be displayed along with ad.

| JSON representation |
|---|
| ``` { "click_data": object(ClickData), "creative_type": string, "height": int32, "width": int32, "resource": string, "type": string, "ad_slot_id": string, "api_framework": string, "tracking_events": [object(TrackingEvent)], } ``` |

| Fields ||
|---|---|
| `click_data` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#clickdata` The click data for this companion. |
| `creative_type` | `string` The CreativeType attribute on the \<StaticResource\> node in the VAST if this is a companion of type static. |
| `height` | `int32` The height in pixels of this companion. |
| `width` | `int32` The width in pixels of this companion. |
| `resource` | `string` For static and iframe companions this will be the URL to be loaded and displayed. For HTML companions, this will be the HTML snippet that should be shown as the companion. |
| `type` | `string` Type of this companion. It can be either static, iframe or HTML. |
| `ad_slot_id` | `string` The slot ID for this companion. |
| `api_framework` | `string` The API framework for this companion. |
| `tracking_events` | `https://developers.google.com/ad-manager/dynamic-ad-insertion/api/pod-serving/reference/live#trackingevent` List of tracking events for this companion. |

### InteractiveFile

InteractiveFile contains information for interactive creative (i.e. SIMID) that should be displayed during ad playback.

| JSON representation |
|---|
| ``` { "resource": string, "type": string, "variable_duration": boolean, "ad_parameters": string, } ``` |

| Fields ||
|---|---|
| `resource` | `string` The URL to the interactive creative. |
| `type` | `string` The MIME type of the file provided as the resource. |
| `variable_duration` | `boolean` Whether this creative may ask for the duration to be extended. |
| `ad_parameters` | `string` The value of the \<AdParameters\> node in the VAST. |