Delete booking sheet exceptions within a date range

DELETE /api/booking-sheets/exception/{scheduleId}

Success: 200 OK

Overview

Removes exceptions from a schedule created by Create one or more booking sheet exceptions, putting the time back on sale. A schedule usually holds many exceptions — one per generated date, per time band, per product — and this call removes those that fall inside the date range you give, across every product and time band in the schedule. There is no way to remove a single exception from within a schedule by id.

Two things about the range are easy to get wrong. Only exceptions that sit entirely inside it are removed: one that starts before fromDate or ends after toDate is left in place, so widen the range rather than trimming it to the block you have in mind. And the whole range must be in the future — you cannot clear a closure that has already begun.

Dates removed this way are also added to the schedule's exclusion dates, so a recurring pattern does not simply regenerate them.

On success the endpoint returns 200 OK with a plain string body of the form {count} exceptions deleted. If the schedule has no exceptions at all, or none inside the range, you get a 404 rather than a count of zero.

Endpoint

DELETE {base_url}/api/booking-sheets/exception/{scheduleId}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
scheduleIdstringYesThe schedule whose exceptions you are removing — the scheduleId returned when the exceptions were created by Create one or more booking sheet exceptions. It identifies the whole set created by that one request, not an individual exception. An empty value is rejected with Schedule ID must be specified, a non-GUID with Schedule ID is not a valid GUID, and a GUID with no exceptions behind it with No exceptions found for Schedule ID '{scheduleId}'.

Query parameters

NameTypeRequiredDescription
fromDatestring (date-time)NoThe earliest point an exception may start at and still be removed; anything starting before it is left alone. Defaults to the moment the request is handled when omitted, which is the safe choice — an explicit value even slightly in the past is rejected with You cannot specify a date range that is partly or entirely in the past. Must be strictly earlier than toDate (fromDate must be before toDate). Send the site's local wall-clock time rather than converting to UTC yourself, because exception times are compared in site local time.
toDatestring (date-time)NoThe latest point an exception may end at and still be removed; anything ending after it is left alone, even if it started inside the range. Defaults to the maximum representable date when omitted, which clears every future exception on the schedule. Must be in the future and later than fromDate. Interpreted as site wall-clock time, as fromDate is.

Sample request

cURL
curl -X DELETE '{base_url}/api/booking-sheets/exception/{scheduleId}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Sample response

200 OK
"12 exceptions deleted"

Errors

StatusMeaningWhen
400Bad requestThe schedule id is unusable: Schedule ID must be specified for an empty value, or Schedule ID is not a valid GUID for anything that does not parse as a GUID.
400Bad requestThe range is unusable: fromDate must be before toDate when they are equal or the wrong way round, or You cannot specify a date range that is partly or entirely in the past when either end is before the current instant.
400Bad requestRemoving the exceptions failed — A database error occurred.
404Not foundThe schedule holds no exceptions at all — No exceptions found for Schedule ID '{scheduleId}'. You also get this after a successful delete has removed the last of them.
404Not foundThe schedule exists but nothing falls in the range — No exceptions found for Schedule ID '{scheduleId}' in the specified date range. Raised both when every exception on the schedule has already finished, and when none of them sits inside fromDate–toDate.
500Internal server errorAn unexpected server-side failure, with an empty body.

This page as markdown · All pages · llms.txt