Ad InsertionConfigure Pre-Roll Ads

Configure Pre-Roll Ads

Enables or disables live ad pre-roll. When enabled is N the pre-roll configuration is removed entirely.

curl -X POST "https://api.5centscdn.com/v2/streams/push/123/adinsertion/preroll" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "enabled": "Y",
  "maxDuration": 30,
  "offset": 0,
  "startOver": "Y"
}'
{
  "result": "success"
}
POST
/streams/push/{streamid}/adinsertion/preroll
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key (sent in header)

path
streamidinteger
Required

Numeric stream ID.

Content-Typestring
Required

The media type of the request body

Options: application/json
enabledstring
Required

Enable or disable pre-roll.

Options: Y, N
maxDurationinteger

Maximum pre-roll duration in seconds.

Min: 1 • Max: 7200
offsetinteger

Playback offset in seconds before the pre-roll starts.

Min: 0 • Max: 60
startOverstring

Pass Y to restart the stream from the beginning after the pre-roll.

Options: Y
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. Provide your API key in the header.

Path Parameters

streamidinteger
Required

Numeric stream ID.

Body

application/json
enabledstring
Required

Enable or disable pre-roll.

Allowed values:YN
maxDurationinteger

Maximum pre-roll duration in seconds.

offsetinteger

Playback offset in seconds before the pre-roll starts.

startOverstring

Pass Y to restart the stream from the beginning after the pre-roll.

Allowed values:Y

Responses

resultstring
Required

Status of the API response.

Allowed values:successerror
messagestring

Human-readable message describing the result.