Ad InsertionAdd Ad Break Schedule

Add Ad Break Schedule

Custom Plan Adds a new ad break schedule. Two schedule types are supported. Maximum 10 schedules per stream.

curl -X POST "https://api.5centscdn.com/v2/streams/pull/123/adinsertion/schedule" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "_METHOD": "PUT",
  "type": 1,
  "duration": 60,
  "value": "0 */5 * * * *",
  "mode": "schedule",
  "recur": 1
}'
{
  "result": "success",
  "message": "Added: 1, Failed: 151",
  "messages": {
    "added": {
      "1778066400": 1370623
    },
    "failed": {
      "1778066700": "Recur limit reached"
    }
  }
}
POST
/streams/pull/{streamid}/adinsertion/schedule
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
_METHODstring

HTTP method override for this request. This endpoint accepts POST, but set this to PUT to perform an update operation.

typeinteger
Required

Schedule type: 1 for Recurring, 2 for One-time.

Options: 1, 2
durationinteger
Required

Ad break duration in seconds.

Min: 10 • Max: 180
valuestring
Required

Quartz cron expression (type 1) or Unix timestamp (type 2).

modestring

Pass create to save the schedule without generating triggers, or schedule to immediately create triggers as well.

Options: create, schedule
recurinteger

Maximum number of trigger repetitions. 0 means unlimited.

Min: 0 • Max: 720
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
_METHODstring

HTTP method override for this request. This endpoint accepts POST, but set this to PUT to perform an update operation.

Example:
PUT
typeinteger
Required

Schedule type: 1 for Recurring, 2 for One-time.

Allowed values:12
durationinteger
Required

Ad break duration in seconds.

Example:
60
valuestring
Required

Quartz cron expression (type 1) or Unix timestamp (type 2).

Example:
0 */5 * * * *
modestring

Pass create to save the schedule without generating triggers, or schedule to immediately create triggers as well.

Allowed values:createschedule
recurinteger

Maximum number of trigger repetitions. 0 means unlimited.

Example:
1

Responses

resultstring

Status of the API response.

Allowed values:successerror
messagestring

Summary of added and failed trigger counts.

messagesobject

Informational messages related to the stream state.