Skip to main content

Business hours & calendars

Define business-hours rules and calendars (with special dates) used by routing and automations. Available as mgr.businessHours / mgr.BusinessHours / mgr.business_hours and mgr.calendars / mgr.Calendars / mgr.calendars.

Business hours

for await (const b of mgr.businessHours.list()) console.log(b.id);
const created = await mgr.businessHours.create({ /* RestCreateBusinessHourBody */ });
await mgr.businessHours.update(created.item.id, { /* RestUpdateBusinessHourBody */ });
await mgr.businessHours.delete(created.item.id);

Calendars

CRUD plus calendar dates (getDates / addDate).

for await (const c of mgr.calendars.list()) console.log(c.id);
const created = await mgr.calendars.create({ /* RestCreateCalendarBody */ });
await mgr.calendars.getDates(created.item.id);
await mgr.calendars.addDate(created.item.id, { /* CalendarDateBody */ });
await mgr.calendars.delete(created.item.id);

Ranges, individual dates & bulk operations

Business hours expose their weekly ranges (list/add/get/remove) and bulk update/delete across records; calendars expose individual dates (get/update/remove), a testDate helper to evaluate a date against the calendar, and bulk update/delete.

await mgr.businessHours.addRanges(bhId, { /* BusinessHourRangesBody */ });
const ranges = await mgr.businessHours.listRanges(bhId);
await mgr.businessHours.getRange(bhId, rangeId);
await mgr.businessHours.removeRange(bhId, rangeId);
await mgr.businessHours.bulkUpdate({ /* BusinessHourBulkUpdateRequest */ });
await mgr.businessHours.bulkDelete([bhId1, bhId2]);

await mgr.calendars.getDate(calId, dateId);
await mgr.calendars.updateDate(calId, dateId, { /* CalendarDateBody */ });
await mgr.calendars.removeDate(calId, dateId);
const test = await mgr.calendars.testDate("2026-12-25");
await mgr.calendars.bulkUpdate({ /* CalendarBulkUpdateRequest */ });
await mgr.calendars.bulkDelete([calId1, calId2]);

Reference