Method: liveBroadcasts.insertCuepoint

Inserts an ad cuepoint into a broadcast, replacing the Content-Owner-only liveCuepoints.insert method without requiring Content Owner authorization. In the Cuepoint request body, cueType is required (cueTypeAd), and durationSecs, insertionOffsetTimeMs, and walltimeMs are optional (insertionOffsetTimeMs and walltimeMs are mutually exclusive).

For method-specific error responses, see liveBroadcasts.insertCuepoint errors.

HTTP request

POST https://youtube.googleapis.com/youtube/v3/liveBroadcasts/cuepoint

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
id

string

Required. Unique ID of the broadcast into which the cuepoint is inserted.

onBehalfOfContentOwner

string

Intended exclusively for YouTube content partners and valid only in an authorized request. Indicates that the request's authorization credentials identify a YouTube CMS user acting on behalf of the specified content owner, allowing partners that manage multiple channels to authenticate once and access data for linked channels. The CMS account must be linked to the specified YouTube content owner.

onBehalfOfContentOwnerChannel

string

Intended exclusively for YouTube content partners and valid only in an authorized request. Specifies the YouTube channel ID of the channel to act on behalf of for this broadcast request. Required whenever onBehalfOfContentOwner is set, and usable only in conjunction with that parameter. The CMS account must be linked to the content owner specified by onBehalfOfContentOwner, and that content owner must link the channel specified by onBehalfOfContentOwnerChannel.

Request body

The request body contains data with the following structure:

JSON representation
{
  "id": string,
  "durationSecs": integer,
  "insertionOffsetTimeMs": string,
  "walltimeMs": string,
  "cueType": enum,
  "etag": string
}
Fields
id

string

Output only. Unique identifier assigned by YouTube for the inserted cuepoint resource.

durationSecs

integer (uint32 format)

Duration of the cuepoint in seconds. Defaults to 30 for broadcasts with fixed-duration ad breaks and 60 otherwise.

insertionOffsetTimeMs

string (int64 format)

Non-negative offset in milliseconds from the beginning of the broadcast's monitor stream (including the testing phase, if applicable) at which to insert the cuepoint; see Setting time offsets. Setting this field (including 0) requires enableMonitorStream to be true. Omit both insertionOffsetTimeMs and walltimeMs to insert the cuepoint immediately without requiring a monitor stream. Mutually exclusive with walltimeMs.

walltimeMs

string

Unix epoch time in milliseconds (> 0) at which to insert the cuepoint. Mutually exclusive with insertionOffsetTimeMs.

cueType

enum

Required. The cuepoint type. Valid value is cueTypeAd (inserts an ad break).

This enum field has the one valid value:

  • cueTypeAd
etag

string

Etag of this resource.

Response body

Represents an ad cuepoint inserted into a live broadcast. Because of HLS segment boundaries, the actual insertion point can shift by up to 5 seconds from the requested time.

If successful, the response body contains data with the following structure:

JSON representation
{
  "id": string,
  "durationSecs": integer,
  "insertionOffsetTimeMs": string,
  "walltimeMs": string,
  "cueType": enum,
  "etag": string
}
Fields
id

string

Output only. Unique identifier assigned by YouTube for the inserted cuepoint resource.

durationSecs

integer (uint32 format)

Duration of the cuepoint in seconds. Defaults to 30 for broadcasts with fixed-duration ad breaks and 60 otherwise.

insertionOffsetTimeMs

string (int64 format)

Non-negative offset in milliseconds from the beginning of the broadcast's monitor stream (including the testing phase, if applicable) at which to insert the cuepoint; see Setting time offsets. Setting this field (including 0) requires enableMonitorStream to be true. Omit both insertionOffsetTimeMs and walltimeMs to insert the cuepoint immediately without requiring a monitor stream. Mutually exclusive with walltimeMs.

walltimeMs

string

Unix epoch time in milliseconds (> 0) at which to insert the cuepoint. Mutually exclusive with insertionOffsetTimeMs.

cueType

enum

Required. The cuepoint type. Valid value is cueTypeAd (inserts an ad break).

This enum field has the one valid value:

  • cueTypeAd
etag

string

Etag of this resource.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtubepartner
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.