# Sites

Websites, either single-unit or catalog sites

Endpoint: `https://api.bookingmood.com/v1/sites`, supporting `GET`, `PATCH`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.bookingmood.com/hu-HU/api-reference/authentication.md)).

## The site object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `uuid` | Unique identifier. |
| `organization_id` | `uuid` | Identifier of the organization this site is defined in. References [`organizations.id`](https://www.bookingmood.com/hu-HU/api-reference/organizations.md). |
| `created_at` | `timestamp with time zone` | Creation timestamp. Read-only: set by the database. |
| `updated_at` | `timestamp with time zone` | Last modification timestamp. Read-only: set by the database. |
| `autocomplete_date_selection` | `boolean` | Whether to autocomplete the date selection when only one date is available. |
| `color_background` | `text` | Background color of the site. |
| `color_booked` | `text` | Color of booked dates. |
| `color_closed` | `text` | Color of closed dates. |
| `color_error` | `text` | Error color of the site. |
| `color_header` | `text` | Header color of the site. |
| `color_info` | `text` | Info color of the site. |
| `color_primary` | `text` | Primary color of the site. |
| `color_text` | `text` | Text color of the site. |
| `color_unavailable` | `text` | Color of unavailable dates. |
| `color_warning` | `text` | Warning color of the site. |
| `cover` | `text \| null` | URL of the cover image. |
| `currency` | `Currency` | Currency of the site. |
| `custom_domain` | `text \| null` | Custom domain of the site. |
| `custom_html` | `text` | Custom HTML added to every page of the site. |
| `date_visibility` | `WidgetDateVisibility` | Which dates the calendar shows: `all`, `hide-closed` to hide closed dates, `hide-unavailable` to hide unavailable dates, or the deprecated `custom` to show selected months. |
| `enable_shopping_cart` | `boolean` | Whether guests can book multiple units at once. |
| `failure_url` | `text` | URL to redirect to when a payment fails. `__BOOKING_PAGE__` shows the guest page. |
| `filters` | `text[]` | Filters to show in the search bar. |
| `first_week_contains_date` | `1 \| 4 \| null` | Day of January the first week of the year contains: `1`, or `4` as in ISO 8601. |
| `font` | `text \| null` | Font of the site. |
| `fts` | `tsvector` | Read-only: set by the database. |
| `icon` | `text \| null` | URL of the icon image. |
| `initial_date` | `WidgetInitialDate` | Initial date shown in the calendar. |
| `interval_wrap_style` | `ChannelIntervalWrapStyle` | Style of the interval when wrapping weeks. |
| `logo` | `text \| null` | URL of the logo image. |
| `logo_alt` | `text \| null` | URL of the logo image for dark backgrounds. |
| `logo_size` | `integer \| null` | Size of the logo in pixels, or null for automatic. |
| `name` | `MultiLanguageString` | Localized name of the site. |
| `password_hash` | `text \| null` | Hash of the password required to access the site. |
| `pricing_version` | `SitePricingVersion` | Version of Bookingmood's pricing that applies to the site: `V1` sites are paid, older `V0` sites are free. |
| `rate_location` | `ChannelRateLocation` | Where rates are shown in the calendar: `inline` or `tooltip`. |
| `rate_visibility` | `ChannelRateVisibility` | Which rates the calendar shows: `all`, `available` or `none`. |
| `redirect_url` | `text \| null` | URL to redirect to after submitting a booking. |
| `related_products` | `SiteRelatedProducts \| null` | Settings of the related units section on unit pages. |
| `show_booked_as` | `ShowBookedAs` | How to show booked dates. |
| `show_branding` | `boolean` | Whether to show the Bookingmood branding. |
| `show_closed_as` | `ShowClosedAs` | How to show closed dates. |
| `show_complex_prices` | `boolean` | Whether guests can inspect seasonal prices in the calendar. |
| `show_legend` | `boolean` | Whether to show a legend in the calendar. |
| `show_pending_as` | `CalendarEventStatus` | How to interpret pending events. |
| `show_pricing` | `boolean` | Whether to show the pricing section on unit pages. |
| `show_searchbar` | `boolean` | Whether to show the search bar. |
| `show_totals` | `boolean` | Whether to show totals in the calendar. |
| `show_unavailable_results` | `boolean` | Whether search results also list units that don't match the search. |
| `subdomain` | `text` | Subdomain of the site. |
| `type` | `SiteType` | Type of the site: `single-unit-site` or `multi-unit-site`. |
| `week_starts_on` | `Day \| null` | First day of the week: `0` for Sunday or `1` for Monday. |

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "organization_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-10-30T23:18:45.588Z",
  "updated_at": "2026-10-30T23:18:45.588Z",
  "autocomplete_date_selection": false,
  "color_background": "#fff",
  "color_booked": "#faa5a5",
  "color_closed": "#f5f5f5",
  "color_error": "#faa5a5",
  "color_header": "#000",
  "color_info": "#2463eb",
  "color_primary": "#22c55e",
  "color_text": "#000",
  "color_unavailable": "#faa5a5",
  "color_warning": "#a75c03",
  "cover": "",
  "currency": "USD",
  "custom_domain": "",
  "custom_html": "",
  "date_visibility": "all",
  "enable_shopping_cart": false,
  "failure_url": "__BOOKING_PAGE__",
  "filters": [
    ""
  ],
  "first_week_contains_date": 0,
  "font": "",
  "icon": "",
  "initial_date": "today",
  "interval_wrap_style": "square",
  "logo": "",
  "logo_alt": "",
  "logo_size": 0,
  "name": {},
  "password_hash": "",
  "pricing_version": "V0",
  "rate_location": "inline",
  "rate_visibility": "available",
  "redirect_url": "https://example.com",
  "related_products": {
    "count": 3,
    "show_address": true,
    "show_capacity": true,
    "show_price_range": true,
    "show_rating": true
  },
  "show_booked_as": "unavailable",
  "show_branding": true,
  "show_closed_as": "closed",
  "show_complex_prices": true,
  "show_legend": true,
  "show_pending_as": "TENTATIVE",
  "show_pricing": true,
  "show_searchbar": true,
  "show_totals": true,
  "show_unavailable_results": true,
  "subdomain": "",
  "type": "multi-unit-site",
  "week_starts_on": 0
}
```

### Types

```typescript
type CalendarEventStatus = "CONFIRMED" | "TENTATIVE" | "CANCELLED";

type ChannelIntervalWrapStyle = "square" | "jagged";

type ChannelRateLocation = "inline" | "tooltip";

type ChannelRateVisibility = "all" | "available" | "none";

type Currency = 
  | "ARS"
  | "AUD"
  | "BRL"
  | "BYN"
  | "CAD"
  | "CHF"
  | "CLP"
  | "CNY"
  | "COP"
  | "CZK"
  | "DKK"
  | "EGP"
  | "EUR"
  | "GBP"
  | "HKD"
  | "HUF"
  | "ILS"
  | "INR"
  | "JPY"
  | "KRW"
  | "KYD"
  | "MAD"
  | "MXN"
  | "MYR"
  | "NGN"
  | "NOK"
  | "NZD"
  | "PEN"
  | "PHP"
  | "PLN"
  | "RON"
  | "RUB"
  | "SEK"
  | "SGD"
  | "THB"
  | "TRY"
  | "TWD"
  | "UAH"
  | "USD"
  | "XOF"
  | "VND"
  | "ZAR";

type Day = 6 | 0 | 1 | 2 | 3 | 4 | 5;

type Language = 
  | "be-BY"
  | "bg-BG"
  | "cs-CZ"
  | "da-DK"
  | "de-DE"
  | "en-GB"
  | "en-NZ"
  | "en-US"
  | "es-ES"
  | "eu-ES"
  | "fr-FR"
  | "gr-EL"
  | "he-IL"
  | "hr-HR"
  | "hu-HU"
  | "it-IT"
  | "ja-JP"
  | "lt-LT"
  | "lv-LV"
  | "nl-NL"
  | "nn-NO"
  | "pl-PL"
  | "pt-BR"
  | "ro-RO"
  | "ru-RU"
  | "sk-SK"
  | "sl-SI"
  | "sr-Cyrl"
  | "sr-Latn"
  | "sv-SE"
  | "tr-TR"
  | "uk-UA";

type MultiLanguageString = {
  default: string;
} & Partial<Record<Language, string>>;

type ShowBookedAs = "booked" | "unavailable";

type ShowClosedAs = "closed" | "unavailable";

type SitePricingVersion = "V0" | "V1";

type SiteRelatedProducts = {
  count: number;
  show_address: boolean;
  show_capacity: boolean;
  show_price_range: boolean | "week";
  show_rating: boolean;
};

type SiteType = "multi-unit-site" | "single-unit-site";

type WidgetDateVisibility = "all" | "hide-unavailable" | "hide-closed" | "custom";

type WidgetInitialDate = "today" | "next-available";
```

### Related resources

Embed related resources with the [`select` parameter](https://www.bookingmood.com/hu-HU/api-reference/selecting.md), e.g. `select=*,organizations!organization_id(*)`. Resources related through more than one column need the column as a hint, like `table!column(*)`.

| Embed | Type | Description |
| --- | --- | --- |
| `organizations!organization_id(*)` | `object \| null` | The [organization](https://www.bookingmood.com/hu-HU/api-reference/organizations.md) referenced by `organization_id`. |
| `bookings(*)` | `array` | The [bookings](https://www.bookingmood.com/hu-HU/api-reference/bookings.md) referencing this site through `bookings.site_id`. |
| `site_listings(*)` | `array` | The [site listings](https://www.bookingmood.com/hu-HU/api-reference/site_listings.md) referencing this site through `site_listings.site_id`. |
| `site_nav_items(*)` | `array` | The [site nav items](https://www.bookingmood.com/hu-HU/api-reference/site_nav_items.md) referencing this site through `site_nav_items.site_id`. |
| `site_pages!site_id(*)` | `array` | The [site pages](https://www.bookingmood.com/hu-HU/api-reference/site_pages.md) referencing this site through `site_pages.site_id`. |
| `site_views(*)` | `array` | The [site views](https://www.bookingmood.com/hu-HU/api-reference/site_views.md) referencing this site through `site_views.site_id`. |

## List sites

`GET /v1/sites`

Filter on any attribute with `column=operator.value` (see [filtering](https://www.bookingmood.com/hu-HU/api-reference/filtering.md)). Choose columns and embed related resources with `select` (see [selecting](https://www.bookingmood.com/hu-HU/api-reference/selecting.md)), and sort and paginate with `order`, `limit` and `offset` (see [sorting and pagination](https://www.bookingmood.com/hu-HU/api-reference/sorting-pagination.md)).

```bash
curl -X GET "https://api.bookingmood.com/v1/sites?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Responses:

- `200`: A list of sites with the selected columns. `206` when the list is a partial range.
- `400`: The request is malformed, for example an unknown column or an invalid filter.
- `401`: The API key is missing or invalid.

## Update sites

`PATCH /v1/sites`

Filter on any attribute with `column=operator.value` (see [filtering](https://www.bookingmood.com/hu-HU/api-reference/filtering.md)). Without filters, this request updates all sites you have access to. Always filter on at least one column, e.g. `id=eq.{id}`. The body holds the attributes to change.

```bash
curl -X PATCH "https://api.bookingmood.com/v1/sites?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "autocomplete_date_selection": false
  }'
```

Responses:

- `200`: The updated sites with the selected columns. `204` without a body when sending the header `Prefer: return=minimal`.
- `400`: The request is malformed, for example an unknown column, an invalid filter or an invalid body.
- `401`: The API key is missing or invalid.
- `403`: The API key has no permission for this change, for example when writing rows of another organization.
- `409`: The change conflicts with existing data, for example a duplicate key or a reference to a row that does not exist.

Errors have a JSON body with a `code`, `message`, `details` and `hint`. See the [introduction](https://www.bookingmood.com/hu-HU/api-reference.md) for more on errors. The full API is described by the OpenAPI spec at https://api.bookingmood.com/v1/openapi.json.
