Ad InsertionConfigure Ad Replacement

Configure Ad Replacement

Enables or disables live ad replacement. When enabled is N the replacement configuration is removed entirely.

curl -X POST "https://api.5centscdn.com/v2/streams/push/123/adinsertion/replacement" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "enabled": "Y",
  "gapFiller": "",
  "maxAdDurationExcess": 0,
  "pastAdBreakReplacement": 0,
  "pastAdBreakReplacementValue": "",
  "onStartWithinAdBreak": "replace",
  "scte35": {
    "adBreakTriggers": [
      "0x22",
      "0x30",
      "0x32",
      "0x34",
      "0x36",
      "0x38",
      "0x3a",
      "splice_insert"
    ],
    "markersToRemove": [
      "ALL"
    ]
  }
}'
{
  "result": "success"
}
POST
/streams/push/{streamid}/adinsertion/replacement
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 ad replacement.

Options: Y, N
gapFillerstring

URL to a gap-filler asset shown when no ad is available.

maxAdDurationExcessinteger

Maximum seconds an ad can exceed the scheduled break duration.

Min: 0 • Max: 180
pastAdBreakReplacementinteger

Behaviour for late-joining viewers: 0 disabled, -1 replace from break start, -2 use look-back window.

Options: -2, -1, 0
pastAdBreakReplacementValueinteger

Look-back window in seconds.

Min: 1 • Max: 7200
onStartWithinAdBreakstring

What to do when a viewer joins mid-break.

Options: replace, skip_ad_break
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 ad replacement.

Allowed values:YN
gapFillerstring

URL to a gap-filler asset shown when no ad is available.

maxAdDurationExcessinteger

Maximum seconds an ad can exceed the scheduled break duration.

pastAdBreakReplacementinteger

Behaviour for late-joining viewers: 0 disabled, -1 replace from break start, -2 use look-back window.

Allowed values:-2-10
pastAdBreakReplacementValueinteger

Look-back window in seconds.

onStartWithinAdBreakstring

What to do when a viewer joins mid-break.

Allowed values:replaceskip_ad_break
scte35object

Responses

resultstring
Required

Status of the API response.

Allowed values:successerror
messagestring

Human-readable message describing the result.