Free/busy and availability
Scheduling a meeting requires knowing when every attendee is free, but users rarely want colleagues to read the details of their calendars. Free/busy information solves this. It tells another user when someone is busy, without revealing what the events are, so that a meeting can be placed at a time when every attendee is free. Stalwart answers free/busy queries over JMAP and over CalDAV.
This page explains which calendars and events contribute to the answer, how working hours mark the rest of the week as unavailable, who may ask, and the limits that apply. An administrator needs this when users ask why a colleague appears free during a meeting, or why two clients show different free/busy for the same person.
Availability queries
Section titled “Availability queries”Clients ask for free/busy time in three ways. JMAP clients call Principal/getAvailability, part of the urn:ietf:params:jmap:principals:availability capability defined by JMAP for Calendars. The response lists the busy periods for the requested time range.
CalDAV scheduling clients send a free/busy request, an iTIP VFREEBUSY request (RFC 6638), to their scheduling outbox, usually while the user composes an invitation. The request follows the rules of calendar scheduling, and it can ask about several attendees at once.
CalDAV clients can also run a free-busy-query REPORT (RFC 4791) on a single calendar collection. This requires the davCalFreeBusyQuery permission.
The JMAP method and the scheduling request apply the same rules, described in the next three sections. Principal/getAvailability requires the jmapPrincipalGetAvailability permission, and Principal/get reports mayGetAvailability as true for the principals the requester may query. The free-busy-query REPORT works differently, as described in Free/busy over CalDAV.
Free/busy is not a directory query. Neither the JMAP method nor the scheduling request depends on allowDirectoryQueries, which is described in Sharing. With directory queries disabled, users cannot search for other accounts, but they can still query the availability of an account whose identifier or address they know.
Calendars that count
Section titled “Calendars that count”A calendar contributes to a user’s availability only when two conditions hold. The first is that the requester may read free/busy information on it. Members of the account that owns the calendar always may. Other users need the right to read free/busy, or the right to read items, on that calendar, granted by sharing. While Calendar.shareFreeBusy is enabled, as it is by default, no share is needed for free/busy: every account may read the free/busy time of the other accounts in its tenant, or of every account on the server when tenants are not used, as users of an Exchange organisation expect. Event details still require the right to read items. The second condition is that the owner is subscribed to the calendar. A calendar the owner has unsubscribed from never counts.
Among those calendars, each user also decides which ones count towards their availability. The decision is made through the includeInAvailability property of the calendar in JMAP:
| Value | Effect |
|---|---|
all | Every event in the calendar counts. |
attending | Only events the user attends count. |
none | The calendar does not count. |
When the user has not set a value, the value applied depends on how the user reaches the calendar. It is all for a calendar that belongs to the user’s own account, or to a group account the user is a member of. It is none for a calendar that is only shared with the user. An explicit value always takes precedence. Calendar/get reports the same default, so clients show the value the server applies. A user who wants a calendar shared with them to count sets it to all or attending.
Events that count
Section titled “Events that count”Not every event on a counted calendar makes the user busy. Cancelled events are ignored. Events marked secret (iCalendar CLASS:CONFIDENTIAL) are ignored too, with one exception: CalDAV free/busy requests by members of the owning account count them. Overlapping busy periods are merged into one.
A busy period normally carries no details. It carries event details, such as the title, only when the requester may read the events of that calendar, and never for private events. Event privacy describes how event privacy is applied.
Working hours
Section titled “Working hours”Free/busy shows when a user is busy, but an empty calendar does not mean that the user is working. Working hours fill that gap. A user who sets them appears unavailable outside them, so an organiser’s client does not propose a meeting at night or on a day off, even when the calendar is empty at that time.
Working hours are kept per account in the CalendarSettings object (found in the WebUI under Account › Calendars › Settings). User and resource accounts have one; group accounts do not. Its workingHours field has three parts:
enableturns the working hours on. It is disabled until the user sets it.timeZoneis the IANA time zone in which the times are read. When it is not set, the account’s own time zone applies, and UTC when the account has none.slotslists up to 14 weekly intervals. Each interval has a set ofdaysand astartandendtime written asHH:MM.
An interval cannot cross midnight. Its end may be 24:00, and a shift that runs past midnight is entered as two intervals, one on each day. Intervals that overlap or touch on the same day are merged. Working hours that are enabled without any interval have no effect. The following object body sets a working day split by a lunch break, from Monday to Friday:
{ "workingHours": { "enable": true, "timeZone": "Europe/Madrid", "slots": [ {"days": {"monday": true, "tuesday": true, "wednesday": true, "thursday": true, "friday": true}, "start": "09:00", "end": "13:00"}, {"days": {"monday": true, "tuesday": true, "wednesday": true, "thursday": true, "friday": true}, "start": "15:00", "end": "18:00"} ] }}A value the server cannot use is refused with invalidProperties and a description such as Working hours interval <n> must start before it ends, within one day.
Effect on free/busy
Section titled “Effect on free/busy”The time outside working hours is reported as unavailable. A CalDAV free/busy request to the scheduling outbox returns it as BUSY-UNAVAILABLE periods, and Principal/getAvailability as periods with the busy status unavailable. JMAP includes these periods only when the requester may read at least one of the owner’s calendars, which every query on a resource satisfies. The free-busy-query REPORT ignores working hours, as it ignores the other availability settings.
Working hours do not hide events. An event outside working hours still makes the user busy, so an attendee who accepted an early meeting shows as busy at that time. Where periods overlap, Principal/getAvailability reports the strongest status: a confirmed event outranks unavailable time, which outranks a tentative event. The unavailable periods count towards the limit on busy periods per answer, described in Free/busy over CalDAV.
Setting working hours
Section titled “Setting working hours”Users set their working hours in three ways, which all change the same object:
- In the WebUI.
- Over JMAP, with the
x:CalendarSettings/getandx:CalendarSettings/setmethods of theurn:stalwart:jmapcapability. The object is a singleton: it cannot be created or destroyed, and onlyworkingHourscan be changed. - Over CalDAV, through the
calendar-availabilityproperty (RFC 7953) of the user’s scheduling inbox. Apple clients use the same property in thehttp://calendarserver.org/ns/namespace, and both names are accepted.
Reading and changing working hours require the sysCalendarSettingsGet and sysCalendarSettingsUpdate permissions, which the default user and group roles include. An OAuth token needs the settings scope. Over CalDAV, only members of the account may change the property, and a request without the permission fails with 403.
CalDAV calendar availability
Section titled “CalDAV calendar availability”The calendar-availability property holds a VAVAILABILITY component, the iCalendar form of a weekly availability. A PROPFIND returns the working hours in that form, with one AVAILABLE component per interval, repeating weekly. A PROPPATCH converts the component the client sends back into intervals, and it accepts only what the intervals can express:
- Exactly one
VAVAILABILITY, without an end or a duration, whoseBUSYTYPE, if present, isBUSY-UNAVAILABLE. OnlyVTIMEZONEcomponents may accompany it. - Between 1 and 14
AVAILABLEcomponents, all in the same IANA time zone, none of them starting later than the next day. - Each
AVAILABLEstarts and ends on the same day, on whole minutes, and repeats every week on whole days, with a singleRRULEand no end, count or exceptions.
Anything else is refused with 403 and the valid-calendar-data precondition, with a description such as AVAILABLE must repeat weekly on whole days, without exceptions or an end. Removing the property turns the working hours off and keeps the intervals. An availability that covers the whole week also turns them off, because it leaves no time unavailable.
VAVAILABILITY is accepted only in this property. Calendars do not store it, and the server does not list it among the components a calendar supports.
Free/busy over CalDAV
Section titled “Free/busy over CalDAV”A free/busy request sent to the scheduling outbox applies the rules above, including includeInAvailability, the attending value and the working hours. For each attendee, the requester needs the right to read items, or the right to read free/busy, on at least one of that attendee’s calendars. The response gives a status for each attendee, so the other attendees are still answered when one of them fails:
| Status | Cause |
|---|---|
3.8;No authority | The requester may not read any of the attendee’s calendars. |
3.10;Request entity too large | The attendee has too many busy periods in the requested range. |
The CalDAV property schedule-calendar-transp reflects the same setting. A calendar is reported as transparent when the owner’s includeInAvailability excludes it, and as opaque otherwise. The property is read-only and cannot be changed with PROPPATCH, so includeInAvailability has to be changed through JMAP instead.
The free-busy-query REPORT behaves differently, because it is defined by RFC 4791, which has no availability settings. It runs on the single calendar collection named in the request, and it ignores includeInAvailability, subscriptions, the attending value and working hours. A requester who does not own the calendar needs both the right to read items and the right to read free/busy. Secret, transparent and cancelled events are skipped, and a tentative event is reported as BUSY-TENTATIVE only when it is public. As a result, a client that uses free-busy-query can show different free/busy time for the same user than JMAP clients and scheduling requests do.
Limits
Section titled “Limits”Two settings on the Calendar object limit availability queries. The first bounds the size of a query: maxAvailabilityDuration is the longest time range one query may cover, 365 days by default. A longer range fails with the JMAP error tooLarge.
The second bounds the rate of queries: availabilityRateLimit limits how often one account may query availability, 100 per minute by default. Over the limit, the query fails with the JMAP error rateLimit. Accounts with the unlimitedRequests permission are exempt.
Tenants are kept apart as well. Users in another tenant are reported as not found, unless the requester holds the sysAccountQuery permission.
Scheduling behaviour that affects availability
Section titled “Scheduling behaviour that affects availability”Scheduling describes how invitation links are built, which iTIP methods are processed and how group attendees are handled. Two of those rules often come up together with free/busy questions. The first is that iTIP COUNTER and DECLINECOUNTER are not supported, so an attendee cannot propose a new time through the server. The second is that an attendee of type group (CUTYPE=GROUP) is not expanded into its members, so the members’ availability is not consulted.