POST/office_hours_schedules/{office_hours_schedule_id}/office_hours_exceptions

Create an office hours exception

Creates an exception that overrides the regular hours for a specific date on an office hours schedule. Supply exception_date and choose closed or custom_hours; provide time_intervals for custom hours and omit it for a closed day. Set recurring_annually to repeat the exception on the same date each year.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 5 body fields
office_hours_schedule_idstringrequired
The unique identifier of the office hours schedule to add the exception to.
Intercom-Versionstringoptional
Selects the Intercom API version. Defaults to `2.17` when omitted; the schema defines the accepted version values.
Allowed:1.01.11.21.31.42.02.12.22.32.42.52.6Default:2.17

Exception details for one schedule date. exception_date and exception_type are required.

exception_datestringrequired
The date the exception applies to, in `YYYY-MM-DD` format.
exception_typestringrequired
The type of exception.
Allowed:closedcustom_hours
namestringoptional
An optional name for the exception.
time_intervalsarray<OfficeHoursTimeInterval>optional
The open intervals for the exception date. Required for `custom_hours`; omit for `closed`.
recurring_annuallybooleanoptional
Whether the exception repeats every year on the same date.

4 status codes
201Returns the created office hours exception, including its identifier, schedule, date, type, intervals, recurrence setting, and creation and update timestamps.
typestringoptional
The type of the object - always `office_hours_exception`.
idstringoptional
The unique identifier for the office hours exception.
office_hours_schedule_idstringoptional
The unique identifier for the schedule this exception belongs to.
exception_datestringoptional
The date the exception applies to, in `YYYY-MM-DD` format.
exception_typestringoptional
`closed` means the workspace is closed all day; `custom_hours` replaces the regular hours with `time_intervals`.
Allowed:closedcustom_hours
namestringoptional
An optional name for the exception.
time_intervalsarray<OfficeHoursTimeInterval>optional
The open intervals for the exception date. `null` when `exception_type` is `closed`.
recurring_annuallybooleanoptional
Whether the exception repeats every year on the same date.
created_atintegeroptional
The time the exception was created as a Unix timestamp.
updated_atintegeroptional
The time the exception was last updated as a Unix timestamp.
401Returned when the request is unauthorized.

One documented failure

  • unauthorized

    Access Token Invalid

typestringrequired
The type is error.list
request_idstringoptional
errorsarray<object>required
An array of one or more error objects
404Returned when the office hours schedule cannot be found.

2 documented failures

  • not_found

    Object not found

  • data_invalid

    Integration not found

typestringrequired
The type is error.list
request_idstringoptional
errorsarray<object>required
An array of one or more error objects
422Returned when the request fails validation, such as when required fields are missing or the exception type and time intervals do not match.

One documented failure

  • data_invalid

    Invalid or duplicated record reference

typestringrequired
The type is error.list
request_idstringoptional
errorsarray<object>required
An array of one or more error objects

Error handling

A 401 is returned when the request is unauthorized. A 404 is returned when the schedule cannot be found. A 422 is returned when the request fails validation. The office_hours_schedule_id path parameter must identify an existing schedule. exception_date and exception_type are required; exception_date must use YYYY-MM-DD, and exception_type must be closed or custom_hours. Include time_intervals for custom_hours and omit it for closed.