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

# Maintenance Mode

> Enables or disables maintenance mode for the specified store.
Requires the `stores.update` permission.

<Warning>
  **This takes your storefront offline for shoppers.** They see your message
  instead of the store and cannot buy anything until it is switched back off.
</Warning>

## The reason is the switch

There is no `enabled` flag - maintenance is on or off depending on whether `reason` has a value.

| Send                              | Result                                   |
| --------------------------------- | ---------------------------------------- |
| `{ "reason": "Back at 3pm UTC" }` | Maintenance **on**, showing that message |
| `{ "reason": null }`              | Maintenance **off**, store live again    |

```bash theme={null}
curl -X PUT "https://api.komerza.com/stores/{storeId}/maintenance" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "User-Agent: MyApp/1.0" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Restocking, back at 3pm UTC"}'
```

## Message rules

Up to **1024 characters**, and only letters, digits, spaces and `. , ! ? ' -`.

<Warning>
  Colons and slashes are rejected, so **a URL will fail validation** - as will
  emoji, `@`, `#`, `&` and brackets.
</Warning>

The message is public, so write it for shoppers.

## Reading the current state

The store object returns `maintenanceReason`; `null` means live.

<Note>
  If the storefront is dark while `maintenanceReason` is `null`, this endpoint
  won't fix it - that's an expired plan, an unpaid Buyer Protection invoice, or
  a suspended account.
</Note>


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.komerza.com/llms.txt).
