> ## Documentation Index
> Fetch the complete documentation index at: https://www.plain.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage business hours overrides

> List, create, update, and delete overrides that replace a schedule's weekly hours for holidays and one-off closures.

An override replaces one schedule's weekly hours on every date from `startsOn` to `endsOn`, both included. On each date in the range, the override's `slots` are the open hours, and a date with no slots is closed. Dates and times are read in the schedule's timezone, so overrides don't take a timezone of their own.

<Snippet file="graphql/sdk-note.mdx" />

These operations require the following permissions:

* `businessHours:read`
* `businessHours:create`
* `businessHours:edit`
* `businessHours:delete`

Dates use `YYYY-MM-DD` and times use `HH:MM`. Overlapping and adjacent slots on the same date are merged when you save.

## List overrides on a schedule

`overrides` on `BusinessHoursSchedule` returns the schedule's overrides, sorted by start date. Filter by `startsOn` and `endsOn` with a `DateFilter`, where `after` is on or after the date and `before` is before it. To list current and upcoming overrides, pass `endsOn: { after: today }`, with today's date in the schedule's timezone. This field supports [Pagination](https://www.plain.com/docs/graphql/pagination.md).

<Snippet file="graphql/get-business-hours-overrides.mdx" />

To fetch one override, use `businessHoursOverride(businessHoursOverrideId:)`. It returns `null` when no override has the ID.

## Create an override

Pass the schedule, a `name`, the date range, and the open `slots`. Leave `slots` out to close every date in the range. The example below opens 24 December for the morning and closes 25 and 26 December.

* `startsOn` can't be before today in the schedule's timezone. Today can be given new hours at any time of day
* An override covers at most 92 days
* Every slot's `date` must fall inside the range, and `closesAt` must be after `opensAt`
* An override can't overlap another override on the same schedule

<Snippet file="graphql/create-business-hours-override.mdx" />

## Update an override

Pass only the fields you want to change.

* `name` is a `StringInput`: pass `{ "value": ... }` to rename
* `startsOn` and `endsOn` move the range. `startsOn` can't move to before today. Dates added to the range are closed, and slots on dates removed from it are dropped
* `slots` replaces every slot on the override. Leave it out to keep the current hours

<Snippet file="graphql/update-business-hours-override.mdx" />

## Delete an override

The schedule's weekly hours apply to the override's dates again.

<Snippet file="graphql/delete-business-hours-override.mdx" />

## Errors

Besides the [common error codes](https://www.plain.com/docs/graphql/error-codes.md), these mutations return:

* [`business_hours_override_in_past`](https://www.plain.com/docs/graphql/error-codes#business_hours_override_in_past): the override starts, or would move to start, before today in the schedule's timezone
* [`business_hours_override_overlaps`](https://www.plain.com/docs/graphql/error-codes#business_hours_override_overlaps): the dates overlap another override on the same schedule. The error message names the override it overlaps


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.