Calendars - Calendar Hours API

List all calendar hours of a calendar

List all calendar hours of the calendar with a specific ID:

GET /calendars/:id/calendar_hours

Response

status: 200 OK
[
  {
    "id": 4558,
    "weekday": "mon",
    "time_from": "09:00",
    "time_until": "17:00"
  }
]

The response contains these fields by default.

Add calendar hours to a calendar

Add calendar hours to a calendar with a specific ID.

POST /calendars/:id/calendar_hours

When creating new calendar hours for a calendar these fields are available.

Response

status: 201 Created
{
  "id": 4558,
  "weekday": "mon",
  "time_from": "09:00",
  "time_until": "17:00"
}

Update calendar hours of a calendar

Update calendar hours with a specific ID of a calendar with a specific ID.

PATCH /calendars/:id/calendar_hours/:hours_id

When updating existing calendar hours for a calendar these fields are available.

Response

status: 200 OK
{
  "id": 4558,
  "weekday": "mon",
  "time_from": "09:00",
  "time_until": "17:00"
}

Remove calendar hours from a calendar

Remove calendar hours with a specific ID link from a calendar with a specific ID.

DELETE /calendars/:id/calendar_hours/:hours_id

Response

status: 204 No Content

Remove all calendar hours from a calendar

Remove all calendar hours from a calendar with a specific ID.

DELETE /calendars/:id/calendar_hours/

Response

status: 204 No Content

Fields

time_from
Required time of day — The time at which the calendar becomes active on the given weekday.
time_until
Required time of day — The time at which the calendar stops being active on the given weekday.
weekday
Required enum — The day of the week. Valid values are:
  • mon: Monday
  • tue: Tuesday
  • wed: Wednesday
  • thu: Thursday
  • fri: Friday
  • sat: Saturday
  • sun: Sunday