Μετάβαση στο περιεχόμενο

Calendar events

Events on the timeline: bookings, blocked periods or notes

The calendar event object

Attributes

iduuid

Unique identifier

booking_iduuid | null
bookings.id

Identifier of the related booking

calendar_iduuid | null
external_calendars.id

Identifier of the external calendar the event is imported from

creator_iduuid | null
user_profiles.user_id

Identifier of the user that created the event

organization_iduuid
organizations.id

Identifier of the organization this event is defined in

product_iduuid
products.id

Identifier of the related unit

created_atread-onlytimestamp with time zone

Creation timestamp

updated_atread-onlytimestamp with time zone

Last modification timestamp

cooldown_timeint32

Number of days blocked after the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

durationread-onlyint32

Number of nights of the event, or days for units rented per day

end_datedate

End date of the event

free_cancellation_daysint32 | null

For stays of bookings: the unit's number of days before arrival until which guests could cancel for free when the stay was booked, or null without free cancellation. Set when the stay is created

ftstsvector
generated_titletext

Title of the event, generated from the unit name and the guest name

has_non_invoiced_itemsboolean

Whether the booking of the event has line items that are not on an invoice

has_open_paymentsboolean

Whether the booking of the event has payments that are due

notestext

Private notes about the event

occupancyRecord<uuid, integer>

Occupancy per capacity group

origintext | null

Origin of the event

paddingread-onlyint32

Deprecated: read-only copy of cooldown_time. Use cooldown_time and preparation_time

preparation_timeint32

Number of days blocked before the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

start_datedate

Start date of the event

statusCalendarEventStatus

Status of the event

titletext

Title of the event

typeCalendarEventType

Type of the event

uidtext

Identifier of the event in the external calendar

Related resources

Embed related resources in the response with the select parameter, for example select=*,bookings!booking_id(*). Resources related through more than one column need the column as a hint, like table!column(*).

bookings!booking_id(*)object | null
bookings

The booking referenced by booking_id.

external_calendars(*)object | null
external_calendars

The external calendar referenced by calendar_id.

organizations!organization_id(*)object | null
organizations

The organization referenced by organization_id.

products!product_id(*)object | null
products

The product referenced by product_id.

user_profiles!creator_id(*)object | null
user_profiles

The user profile referenced by creator_id.

booking_details(*)array
booking_details

The booking details referencing this calendar event through booking_details.calendar_event_id.

calendar_event_notes(*)array
calendar_event_notes

The calendar event notes referencing this calendar event through calendar_event_notes.calendar_event_id.

line_items(*)array
line_items

The line items referencing this calendar event through line_items.event_id.

tasks(*)array
tasks

The tasks referencing this calendar event through tasks.calendar_event_id.

The calendar event object
JSON
{
  "id": "00000000-0000-0000-0000-000000000000",
  "booking_id": "00000000-0000-0000-0000-000000000000",
  "calendar_id": "00000000-0000-0000-0000-000000000000",
  "creator_id": "00000000-0000-0000-0000-000000000000",
  "organization_id": "00000000-0000-0000-0000-000000000000",
  "product_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-11-30T11:02:01.147Z",
  "updated_at": "2026-11-30T11:02:01.147Z",
  "cooldown_time": 0,
  "duration": 0,
  "end_date": "2026-11-30",
  "free_cancellation_days": 0,
  "generated_title": "Summer cottage",
  "has_non_invoiced_items": false,
  "has_open_payments": false,
  "notes": "A short description.",
  "occupancy": {},
  "origin": "",
  "padding": 0,
  "preparation_time": 0,
  "start_date": "2026-11-30",
  "status": "CONFIRMED",
  "title": "Summer cottage",
  "type": "booking",
  "uid": ""
}
Including related resources
curl "https://api.bookingmood.com/v1/calendar_events?limit=10&select=*,bookings!booking_id(*),external_calendars(*)" \
  -H "Authorization: Bearer YOUR_API_KEY"

List calendar events

Requiresbookings:read

Filters

idFilter<uuid>

Unique identifier

booking_idFilter<uuid | null>
bookings.id

Identifier of the related booking

calendar_idFilter<uuid | null>
external_calendars.id

Identifier of the external calendar the event is imported from

creator_idFilter<uuid | null>
user_profiles.user_id

Identifier of the user that created the event

organization_idFilter<uuid>
organizations.id

Identifier of the organization this event is defined in

product_idFilter<uuid>
products.id

Identifier of the related unit

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

cooldown_timeFilter<int32>

Number of days blocked after the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

durationFilter<int32>

Number of nights of the event, or days for units rented per day

end_dateFilter<date>

End date of the event

free_cancellation_daysFilter<int32 | null>

For stays of bookings: the unit's number of days before arrival until which guests could cancel for free when the stay was booked, or null without free cancellation. Set when the stay is created

ftsFilter<tsvector>
generated_titleFilter<text>

Title of the event, generated from the unit name and the guest name

has_non_invoiced_itemsFilter<boolean>

Whether the booking of the event has line items that are not on an invoice

has_open_paymentsFilter<boolean>

Whether the booking of the event has payments that are due

notesFilter<text>

Private notes about the event

occupancyFilter<Record<uuid, integer>>

Occupancy per capacity group

originFilter<text | null>

Origin of the event

paddingFilter<int32>

Deprecated: read-only copy of cooldown_time. Use cooldown_time and preparation_time

preparation_timeFilter<int32>

Number of days blocked before the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

start_dateFilter<date>

Start date of the event

statusFilter<CalendarEventStatus>

Status of the event

titleFilter<text>

Title of the event

typeFilter<CalendarEventType>

Type of the event

uidFilter<text>

Identifier of the event in the external calendar

Responses

200

A list of calendar events with the selected columns

206

Partial Content

400

The request is malformed, for example an unknown column or an invalid filter.

401

The API key is missing or invalid.

403

The API key or access token doesn't have the scope this request needs.

429

The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
GET/calendar_events
curl "https://api.bookingmood.com/v1/calendar_events?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "calendar_id": "00000000-0000-0000-0000-000000000000",
    "creator_id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "product_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-11-30T11:02:01.147Z",
    "updated_at": "2026-11-30T11:02:01.147Z",
    "cooldown_time": 0,
    "duration": 0,
    "end_date": "2026-11-30",
    "free_cancellation_days": 0,
    "generated_title": "Summer cottage",
    "has_non_invoiced_items": false,
    "has_open_payments": false,
    "notes": "A short description.",
    "occupancy": {},
    "origin": "",
    "padding": 0,
    "preparation_time": 0,
    "start_date": "2026-11-30",
    "status": "CONFIRMED",
    "title": "Summer cottage",
    "type": "booking",
    "uid": ""
  }
]

Create calendar events

Requiresbookings:write

Body

Partial<CalendarEvent> | Array<Partial<CalendarEvent>>

Read-only attributes are set by the database and can't be written.

Responses

201

The newly created calendar events with the selected columns

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 or access token doesn't have the scope this request needs, or 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.

429

The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
POST/calendar_events
curl "https://api.bookingmood.com/v1/calendar_events" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "product_id": "00000000-0000-0000-0000-000000000000",
    "cooldown_time": 0,
    "end_date": "2026-11-30",
    "generated_title": "Summer cottage",
    "has_non_invoiced_items": false,
    "has_open_payments": false,
    "notes": "A short description.",
    "occupancy": {},
    "preparation_time": 0,
    "start_date": "2026-11-30",
    "status": "CONFIRMED",
    "title": "Summer cottage",
    "type": "booking",
    "uid": ""
  }'
Example
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "calendar_id": "00000000-0000-0000-0000-000000000000",
    "creator_id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "product_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-11-30T11:02:01.147Z",
    "updated_at": "2026-11-30T11:02:01.147Z",
    "cooldown_time": 0,
    "duration": 0,
    "end_date": "2026-11-30",
    "free_cancellation_days": 0,
    "generated_title": "Summer cottage",
    "has_non_invoiced_items": false,
    "has_open_payments": false,
    "notes": "A short description.",
    "occupancy": {},
    "origin": "",
    "padding": 0,
    "preparation_time": 0,
    "start_date": "2026-11-30",
    "status": "CONFIRMED",
    "title": "Summer cottage",
    "type": "booking",
    "uid": ""
  }
]

Delete calendar events

Requiresbookings:write

Filters

Without filters, this request deletes all calendar events you have access to. Always filter on at least one column, e.g. id=eq.{id}.

idFilter<uuid>

Unique identifier

booking_idFilter<uuid | null>
bookings.id

Identifier of the related booking

calendar_idFilter<uuid | null>
external_calendars.id

Identifier of the external calendar the event is imported from

creator_idFilter<uuid | null>
user_profiles.user_id

Identifier of the user that created the event

organization_idFilter<uuid>
organizations.id

Identifier of the organization this event is defined in

product_idFilter<uuid>
products.id

Identifier of the related unit

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

cooldown_timeFilter<int32>

Number of days blocked after the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

durationFilter<int32>

Number of nights of the event, or days for units rented per day

end_dateFilter<date>

End date of the event

free_cancellation_daysFilter<int32 | null>

For stays of bookings: the unit's number of days before arrival until which guests could cancel for free when the stay was booked, or null without free cancellation. Set when the stay is created

ftsFilter<tsvector>
generated_titleFilter<text>

Title of the event, generated from the unit name and the guest name

has_non_invoiced_itemsFilter<boolean>

Whether the booking of the event has line items that are not on an invoice

has_open_paymentsFilter<boolean>

Whether the booking of the event has payments that are due

notesFilter<text>

Private notes about the event

occupancyFilter<Record<uuid, integer>>

Occupancy per capacity group

originFilter<text | null>

Origin of the event

paddingFilter<int32>

Deprecated: read-only copy of cooldown_time. Use cooldown_time and preparation_time

preparation_timeFilter<int32>

Number of days blocked before the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

start_dateFilter<date>

Start date of the event

statusFilter<CalendarEventStatus>

Status of the event

titleFilter<text>

Title of the event

typeFilter<CalendarEventType>

Type of the event

uidFilter<text>

Identifier of the event in the external calendar

Responses

200

The deleted calendar events with the selected columns. Returns 204 without a body when sending the header Prefer: return=minimal.

400

The request is malformed, for example an unknown column or an invalid filter.

401

The API key is missing or invalid.

403

The API key or access token doesn't have the scope this request needs, or no permission for this change, for example when writing rows of another organization.

429

The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
DELETE/calendar_events
curl -X DELETE "https://api.bookingmood.com/v1/calendar_events?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "calendar_id": "00000000-0000-0000-0000-000000000000",
    "creator_id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "product_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-11-30T11:02:01.147Z",
    "updated_at": "2026-11-30T11:02:01.147Z",
    "cooldown_time": 0,
    "duration": 0,
    "end_date": "2026-11-30",
    "free_cancellation_days": 0,
    "generated_title": "Summer cottage",
    "has_non_invoiced_items": false,
    "has_open_payments": false,
    "notes": "A short description.",
    "occupancy": {},
    "origin": "",
    "padding": 0,
    "preparation_time": 0,
    "start_date": "2026-11-30",
    "status": "CONFIRMED",
    "title": "Summer cottage",
    "type": "booking",
    "uid": ""
  }
]

Update calendar events

Requiresbookings:write

Filters

Without filters, this request updates all calendar events you have access to. Always filter on at least one column, e.g. id=eq.{id}.

idFilter<uuid>

Unique identifier

booking_idFilter<uuid | null>
bookings.id

Identifier of the related booking

calendar_idFilter<uuid | null>
external_calendars.id

Identifier of the external calendar the event is imported from

creator_idFilter<uuid | null>
user_profiles.user_id

Identifier of the user that created the event

organization_idFilter<uuid>
organizations.id

Identifier of the organization this event is defined in

product_idFilter<uuid>
products.id

Identifier of the related unit

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

cooldown_timeFilter<int32>

Number of days blocked after the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

durationFilter<int32>

Number of nights of the event, or days for units rented per day

end_dateFilter<date>

End date of the event

free_cancellation_daysFilter<int32 | null>

For stays of bookings: the unit's number of days before arrival until which guests could cancel for free when the stay was booked, or null without free cancellation. Set when the stay is created

ftsFilter<tsvector>
generated_titleFilter<text>

Title of the event, generated from the unit name and the guest name

has_non_invoiced_itemsFilter<boolean>

Whether the booking of the event has line items that are not on an invoice

has_open_paymentsFilter<boolean>

Whether the booking of the event has payments that are due

notesFilter<text>

Private notes about the event

occupancyFilter<Record<uuid, integer>>

Occupancy per capacity group

originFilter<text | null>

Origin of the event

paddingFilter<int32>

Deprecated: read-only copy of cooldown_time. Use cooldown_time and preparation_time

preparation_timeFilter<int32>

Number of days blocked before the event. For stays of bookings it follows the booked services and the unit, and is recomputed when those change

start_dateFilter<date>

Start date of the event

statusFilter<CalendarEventStatus>

Status of the event

titleFilter<text>

Title of the event

typeFilter<CalendarEventType>

Type of the event

uidFilter<text>

Identifier of the event in the external calendar

Body

Partial<CalendarEvent>

Read-only attributes are set by the database and can't be written.

Responses

200

The updated calendar events with the selected columns. Returns 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 or access token doesn't have the scope this request needs, or 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.

429

The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
PATCH/calendar_events
curl -X PATCH "https://api.bookingmood.com/v1/calendar_events?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "cooldown_time": 0 }'
Example
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "calendar_id": "00000000-0000-0000-0000-000000000000",
    "creator_id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "product_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-11-30T11:02:01.147Z",
    "updated_at": "2026-11-30T11:02:01.147Z",
    "cooldown_time": 0,
    "duration": 0,
    "end_date": "2026-11-30",
    "free_cancellation_days": 0,
    "generated_title": "Summer cottage",
    "has_non_invoiced_items": false,
    "has_open_payments": false,
    "notes": "A short description.",
    "occupancy": {},
    "origin": "",
    "padding": 0,
    "preparation_time": 0,
    "start_date": "2026-11-30",
    "status": "CONFIRMED",
    "title": "Summer cottage",
    "type": "booking",
    "uid": ""
  }
]