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

# Replace booking blackout dates

> Replaces the location’s whole list of blackout windows: days or part-days when it takes no reservations, such as a private event.

PUT`https://api.maple.inc/v1/locations/{locationId}/booking_blackouts`API key

Replaces the location’s whole list of blackout windows: days or part-days when it takes no reservations, such as a private event. Maple enforces them for native and provider-managed locations alike: availability omits the slots, and a quote taken earlier is refused when held, booked, or used for a change (409 `slot_unavailable` natively, 422 `date_blocked` for provider-managed locations). Existing bookings inside a new window are not cancelled, and walk-ins and waitlist seating are not blocked: a blackout stops reservations only. The venue edits the same list in its dashboard: read `blackout_dates` and `blackout_dates_revision` on the booking profile, and send the revision as `expected_revision` so a list changed since answers 409 `stale_blackout_dates` instead of being overwritten. Invalid ranges answer 400 `invalid_blackout_dates`. Requires `bookings:configure`.

## Authorization

Send your API key as `Authorization: Bearer <key>`: `mpk_test_…` against the sandbox (`https://api.staging.maple.inc/v1`), `mpk_live_…` against production. See [Authentication](https://docs.maple.inc/developer-api/concepts/authentication.md). The samples read the key from `MAPLE_KEY` and the base URL from `MAPLE_BASE`, as set up in the [Quickstart](https://docs.maple.inc/developer-api/quickstart.md).

## Parameters

- `locationId` string path required

## Request body

`application/json`, required.

- `blackout_dates` object\[] required

  The location’s whole list, at most 100 ranges. An empty list clears every blackout.

- `blackout_dates[].start_date` string required

  First blocked day, venue-local `YYYY-MM-DD`.

- `blackout_dates[].end_date` string required

  Last blocked day, inclusive, venue-local `YYYY-MM-DD`.

- `blackout_dates[].start_time` string or null

  Venue-local `HH:MM` the block starts on `start_date`; omit or null to block from the start of the day.

- `blackout_dates[].end_time` string or null

  Venue-local `HH:MM` the block ends on `end_date`, inclusive; omit or null to block through the end of the day.

- `blackout_dates[].reason` string or null

  A note for the venue’s staff, at most 200 characters.

- `expected_revision` string or null

  The `blackout_dates_revision` (or `revision`) you last read. A list changed since answers 409 `stale_blackout_dates` and nothing is written. Omit it to replace the list regardless.

## Responses

### 200 OK

- `object` string required

  Always `booking_blackouts`.

- `location_id` string required

- `blackout_dates` object\[] required

  In start order.

- `blackout_dates[].start_date` string required

  First blocked day, venue-local `YYYY-MM-DD`.

- `blackout_dates[].end_date` string required

  Last blocked day, inclusive, venue-local `YYYY-MM-DD`.

- `blackout_dates[].start_time` string or null required

  Venue-local `HH:MM` the block starts on `start_date`; null blocks from the start of that day.

- `blackout_dates[].end_time` string or null required

  Venue-local `HH:MM` the block ends on `end_date`, inclusive; null blocks through the end of that day.

- `blackout_dates[].reason` string or null required

  The venue’s note, e.g. “Private event”.

- `revision` string required

  The list’s revision. Send it as `expected_revision` on your next write to refuse one that would overwrite a change made since.

### Errors

- `400` Bad request DeveloperApiBadRequest

- `401` Unauthorized DeveloperApiUnauthorized

- `403` Forbidden DeveloperApiForbidden

- `404` Not found DeveloperApiNotFound

- `409` Conflict DeveloperApiConflict

- `422` Unprocessable DeveloperApiUnprocessable

- `429` Too many requests DeveloperApiRateLimited

Every error body names the error in `_tag`, explains it in `message`, and says where to report it in `feedback`. See [Errors](https://docs.maple.inc/developer-api/concepts/errors.md).

A `429` also sends `Retry-After`: Seconds to wait before retrying; also returned as retry\_after in the body.

Replace booking blackout dates

```sh
curl -X PUT "$MAPLE_BASE/locations/str_123/booking_blackouts" \
  -H "Authorization: Bearer $MAPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"blackout_dates":[{"start_date":"string","end_date":"string"}]}'
```

```python
import os
import requests


r = requests.put(
    f"{os.environ['MAPLE_BASE']}/locations/str_123/booking_blackouts",
    headers={"Authorization": f"Bearer {os.environ['MAPLE_KEY']}"},
    json={
        "blackout_dates": [
            {
                "start_date": "string",
                "end_date": "string",
            },
        ],
    },
    timeout=30,
)
r.raise_for_status()
print(r.json())
```

```js
const res = await fetch(`${process.env.MAPLE_BASE}/locations/str_123/booking_blackouts`, {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.MAPLE_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "blackout_dates": [
      {
        "start_date": "string",
        "end_date": "string"
      }
    ]
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

```json
{
  "object": "booking_blackouts",
  "location_id": "str_123",
  "blackout_dates": [
    {
      "start_date": "string",
      "end_date": "string",
      "start_time": "string",
      "end_time": "string",
      "reason": "string"
    }
  ],
  "revision": "string"
}
```

```json
{
  "_tag": "DeveloperApiBadRequest",
  "code": "string",
  "message": "string",
  "feedback": "string"
}
```
