Replace opening hours
PUT /api/v1/properties/{propertyId}/opening-hours
Replaces the whole week. This is a PUT, not a PATCH: a day absent from the body becomes
closed. Send every open day, every time.
Only one continuous range per day is supported.
Authorization
| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
member | Refused — 403 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
openingHours | array | yes | One object per open day |
openingHours[].dayOfWeek | integer | yes | 0 Sunday … 6 Saturday, each day at most once |
openingHours[].openMinute | integer | yes | 0 to 1440, local minutes |
openingHours[].closeMinute | integer | yes | Strictly after openMinute |
Example
bash
curl -X PUT -H "x-api-key: $VILLASLOT_API_KEY" -H "content-type: application/json" \
-d '{"openingHours":[{"dayOfWeek":1,"openMinute":480,"closeMinute":1200}]}' \
"https://villaslot.app/api/v1/properties/1f0a…/opening-hours"Response
200 OK— the saved week, read back.
What it refuses
403 Forbidden— the key bearer is amember.422 Unprocessable Entity—openingHoursmissing or not a list, a closing time before its opening time, a duplicated day, or a minute outside 0–1440.401 Unauthorized— missing or invalid key, or a key whose bearer left the organization.404 Not Found— unknown id, or an id belonging to another organization. The two are deliberately indistinguishable.429 Too Many Requests— over 120 requests in a minute for this key.
Notes
- Existing bookings are not touched. Closing a day does not cancel what was already booked on it; the calendar shows it and the team decides.