---
title: Opening Hours and Exceptions
excerpt: Define time spans and exceptions on your inbound rules, import public holidays, choose destination types and understand how a lookup picks the destination.
order: 3
---

## Time spans

A time span is an opening slot with the destination to return during that slot. Open an inbound rule (or a rules group) and click **Add span**.

| Field | Description |
|---|---|
| **Week day** / **Date** | Either a day of the week (repeats every week) or a specific date. |
| **Start hour** / **End hour** | The slot. The end must be after the start: a slot cannot cross midnight. |
| **Reference** | Optional internal reference, returned by the lookup. Useful to branch in the call flow (for example `open`, `lunch`). |
| **Destination type** / **Destination** | Where the call should go during the slot. Set on inbound rules only, not on groups. |

Both bounds are included: a slot from `09:00` to `12:00` matches a call at `12:00:00`.

To cover a full week, add one span per day and per slot. Use **Replicate** on a row to duplicate it, and **Edit selected** to change several rows at once.

> [!WARNING]
> Avoid overlapping time spans on the same day. The interface does not block them, and a lookup returns only one of them.

## Exceptions

An exception overrides the time spans for a **whole day**: public holiday, exceptional closure, company event. Click **Add exception** on a rule or a group.

| Field | Description |
|---|---|
| **Label** | Name of the exception, returned by the lookup (for example `Christmas Day`). |
| **Date** | The day concerned. |
| **Reference** | Optional internal reference, returned by the lookup. |
| **Destination type** / **Destination** | Where calls go that day (inbound rules only). |

To change the hours of a single day without closing all day (for example closing at noon on 24 December), add a time span on that **Date** instead of an exception: date-specific spans take priority over weekly spans.

### Public holidays

Click **Add next 12 months holidays**, pick a **Country** and, on an inbound rule, the destination. CX-Engine creates one exception per public holiday of that country falling within the **next 12 months**, starting today (the period can span two calendar years):

- **Label**: the name of the holiday
- **Reference**: `{country}:{holiday key}`

A holiday is skipped when the rule or group already has an exception on that day, so you can run the action again at any time (for example every few months) to add the upcoming holidays without creating duplicates. On a rules group, the holidays are pushed to every rule of the group: then set the destination on each rule.

## Destination types

| Type | Description |
|---|---|
| **Extension** | An extension of the PBX |
| **Voicemail** | A voicemail box |
| **Queue** | A queue of the PBX |
| **End call** | Hang up. No destination value is needed. |
| **External number** | A number outside the PBX |
| **Other** | Any other PBX destination (IVR, call flow…) |

The **Destination** field also accepts free text: if your call flow calls another lookup later (for example [geographic routing](/en/docs/smart-routings/contacts-geographic-routing)), you can leave it empty and only use the reference.

> [!WARNING]
> The lookup response returns the `destination` value but **not** its type. If your call flow needs to tell a voicemail from an extension, use a destination format or a `reference` it can recognise.

## How the destination is chosen

For a lookup on an inbound rule at a given date and time:

1. **Exceptions** — if an exception exists on that date, it wins, whatever the time. The response has `"matched": "exception"`.
2. **Time spans on that date** — a span with a specific date that contains the time. `"matched": "time_span,date_full"`.
3. **Weekly time spans** — a span on that day of the week that contains the time. `"matched": "time_span,day_of_week"`.
4. **Nothing matches** — the API answers `404`. This is the usual "closed" case: route the call to your closed message from the call flow.

## Timezone

Time spans and exceptions are entered in **local time**. The lookup evaluates them in the timezone of your account, set in **Account settings** > **Timezone**. The `day` and `time` parameters of the lookup, when provided, are read in that same timezone.

## Automate with the API

Time spans and exceptions can be created, updated and deleted in bulk through the API, and public holidays can be generated for the next 12 months or a given year. See [CX-Engine API › Smart Routings](/en/docs/cx-api/smart-routings).
