# Place breaks at an interval

This guide sets up an [interval rule](https://optiview.dolby.com/docs/ads/concepts/interval-rules.md) twice: on a live channel, for a break every 15 minutes on weekday evenings, and on a VOD channel, for a break every 10 minutes across a movie. See [Interval Rules](https://optiview.dolby.com/docs/ads/concepts/interval-rules.md) for every setting and how interval breaks combine with your other breaks.

## Before you start

* A [channel](https://optiview.dolby.com/docs/ads/concepts/channels.md) on the `wallclock` timebase for live, or a VOD channel on the `mediatime` or `wallclock` timebase. Channels on the `pts` timebase do not support interval rules.
* A [template](https://optiview.dolby.com/docs/ads/concepts/templates.md) with the ad experience the breaks play. When the template has no duration, the rule needs one of its own.
* On a VOD channel: the asset's duration, and on `wallclock` also its start. A channel sync measures them on the channel's [origin](https://optiview.dolby.com/docs/ads/concepts/origins.md), or you set them yourself. See [Asset duration and start](https://optiview.dolby.com/docs/ads/concepts/interval-rules.md#asset-duration-and-start).

## Live: every 15 minutes on weekday evenings

A sports channel wants a 60-second break every 15 minutes from 18:00 to 23:00 on weekdays, Brussels time, starting on 1 December 2026.

### In the Dashboard

1. In the OptiView Unified Dashboard, open **Ads → Live Channels** and select the channel.

2. On the **Breaks** tab, click **Add rule** on the **Interval rules** card.

3. Fill in the rule:

   * **Name**: for example `Weekday evenings`.
   * **Start**: 1 December 2026, 00:00. Leave it empty to start the rule when you save it. **End**: leave it empty to run the rule until you disable it.
   * **Repeat**: **On a schedule**, with the **Cron expression** `*/15 18-22 * * 1-5` and the **Timezone** `Europe/Brussels`. To place a break every N seconds instead, choose **Every interval** and fill in the **Interval (seconds)**.
   * **Break**: select the template. Turn on **Override duration** and enter `60` to use a duration other than the template's.
   * **Minimum spacing (seconds)** and **Priority**: leave them empty unless the channel has other breaks or rules to keep apart from. See [Limits](https://optiview.dolby.com/docs/ads/concepts/interval-rules.md#limits).

4. Click **Create**.

The rule creates each break a few minutes before its slot. The breaks show up in the channel's list of breaks, marked with the rule's name.

### With the Ads API

```bash
curl -X POST 'https://us.ads.optiview.dolby.com/api/v1/channels/<channel-id>/intervalRules' \
  -u "$ADS_API_KEY:$ADS_API_SECRET" \
  -H 'Content-Type: application/json' \
  -H 'X-Org-ID: <org-id>' \
  -d '{
    "name": "Weekday evenings",
    "break": { "templateId": "<template-id>", "duration": 60 },
    "schedule": { "cron": "*/15 18-22 * * 1-5", "timezone": "Europe/Brussels" },
    "startDate": "2026-12-01T00:00:00+01:00"
  }'
```

The rule places its slots at 18:00, 18:15, and so on up to 22:45, Brussels time, on every weekday from 1 December 2026, also across daylight-saving changes. For a break every 15 minutes around the clock, replace `schedule` with `"interval": 900`: the first slot is then at the `startDate`.

## VOD: every 10 minutes across a movie

A movie channel wants a 30-second break every 10 minutes, but none in the first 5 minutes or the last 10 minutes of the movie, and at most 6 breaks.

### In the Dashboard

1. In the OptiView Unified Dashboard, open **Ads → VOD Assets** and select the asset.

2. On the **Overview** tab, check the **Duration** on the **Asset** card. When it reads **Unknown until synced**, sync the channel, or set it with **Edit duration**.

3. Click **Add rule** on the **Interval rules** card, and fill in the rule:

   * **Name**: for example `Every 10 minutes`.
   * **Interval (seconds)**: `600`.
   * **Break**: select the template. Turn on **Override duration** and enter `30` to use a duration other than the template's.
   * **Skip first (s)**: `300`. **Skip last (s)**: `600`. **Max breaks**: `6`.

4. Click **Create**.

5. Click **Apply rules** on the **Interval rules** card. This syncs the interval rules of the channel, which places the breaks.

### With the Ads API

Create the rule:

```bash
curl -X POST 'https://us.ads.optiview.dolby.com/api/v1/channels/<channel-id>/intervalRules' \
  -u "$ADS_API_KEY:$ADS_API_SECRET" \
  -H 'Content-Type: application/json' \
  -H 'X-Org-ID: <org-id>' \
  -d '{
    "name": "Every 10 minutes",
    "break": { "templateId": "<template-id>", "duration": 30 },
    "interval": 600,
    "excludeStart": 300,
    "excludeEnd": 600,
    "maxBreaks": 6
  }'
```

Then sync the channel to place the breaks:

```bash
curl -X POST 'https://us.ads.optiview.dolby.com/api/v1/channels/<channel-id>/sync' \
  -u "$ADS_API_KEY:$ADS_API_SECRET" \
  -H 'Content-Type: application/json' \
  -H 'X-Org-ID: <org-id>' \
  -d '{ "profiles": false, "breakDetection": false }'
```

This sync only applies the interval rules. Without a body, it also applies the channel's profiles and runs break detection. The sync runs in the background: the request returns `202` right away, and the breaks appear once the sync finishes.

On a 100-minute movie with a template that replaces the content, the rule places breaks at 10, 20, 30, 40, 50, and 60 minutes. `maxBreaks` leaves out the ones at 70 and 80 minutes. The one at 90 minutes would be left out anyway: the content would resume in the last 10 minutes.

When you change the rule or its template later, sync the channel again. Viewers who start playback after the sync get the new breaks.

## Check the breaks

List the breaks the rule placed:

```bash
curl 'https://us.ads.optiview.dolby.com/api/v1/channels/<channel-id>/breaks?filter=intervalRuleId==<rule-id>' \
  -u "$ADS_API_KEY:$ADS_API_SECRET" \
  -H 'X-Org-ID: <org-id>'
```

When a break you expect is missing, see [Why a break is missing](https://optiview.dolby.com/docs/ads/concepts/interval-rules.md#why-a-break-is-missing).
