Only show these results:

Calendar Availability

Managing availability to schedule events is one of the most common calendar activities. Nylas provides you with different ways to check availability, free/busy, and availability.

Free/Busy

Free/Busy lets you pass in a time frame and email to return busy times. Free/Busy checks the provider's primary calendar. The email address must be part of the same organization.

Let's look at an example of using /calendars/free-busy for accounts within your organization.

Send a POST request to /calendars/free-busy with the request body :

  • start_time - Unix timestamp for the beginning of the free/busy window.
  • end_time - Unix timestamp for the end of the free/busy window.
  • emails - Email address on the same domain to check. Only one email at a time can be checked.

Free/Busy Request

curl --location --request POST 'https://api.nylas.com/calendars/free-busy' \
--header 'Authorization: Bearer <Bearer-Token>' \
--header 'Content-Type: application/json' \
--data-raw '
{
"start_time":"1600890568",
"end_time":"1600999200",
"emails": ["swag@nylas.com"]
}
'

Free/Busy Response

There are four busy time slots. This means they are free any other time not listed. If there are no busy slots, the request returns an empty time_slots array.

[
{
"email": "swag@nylas.com",
"object": "free_busy",
"time_slots": [
{
"end_time": 1600907400,
"object": "time_slot",
"start_time": 1600890568,
"status": "busy"
},
{
"end_time": 1600961400,
"object": "time_slot",
"start_time": 1600959600,
"status": "busy"
},
{
"end_time": 1600966500,
"object": "time_slot",
"start_time": 1600963200,
"status": "busy"
},
{
"end_time": 1600984800,
"object": "time_slot",
"start_time": 1600979400,
"status": "busy"
}
]
}
]

Free/Busy Empty Time Slots

[
{
"email": "swag@nylas.com",
"object": "free_busy",
"time_slots": []
}
]

Learn More

Review the Free/Busy Status API

How to Create a Calendar Availability Request

There are 2 availability endpoints:

  • /calendars/availability - Check multiple calendars to find available time slots for a single meeting.
  • /calendars/availability/consecutive - Check to find availability for multiple meetings with several participants. Use this endpoint to build itineraries where participants with the same availability are combined.

Each endpoint checks the provider's primary calendar.

The requests to check calendar availability and consecutive availability are made of 3 sections; meeting times, free_busy, and open_hours.

First, you’ll review the 3 main sections of a calendar availability POST request. They consist of:

Then you’ll review the response for calendars/availability and /calendars/availability/consecutive. Finally, there are examples of each showing how you can tailor each request to your needs.

Meeting Time

Meeting time is used to check availability for the specified meeting time between the participants in the emails array. The emails must be in the same organization. The order the emails are entered does not matter.

Create meeting times for both availability and consecutive availability using the request body:

  • duration_minutes - The total number of minutes the event should last.
  • start_time - Unix timestamp for the beginning meeting.
  • end_time - Unix timestamp for the end of the meeting.
  • interval_minutes - How many minutes it should check for availability. For example, if you need to schedule a 30 minute meeting (duration_minutes) and want to check for availability every 10 minutes (interval_minutes).
  • emails - Emails on the same domain to check. If you are using /calendar/availability it accepts an array of emails. If you are using /calendar/consecutive/availability, it accepts a 2D array of emails.

Consecutive Availability 2D Array

When you are using the /consecutive/availability endpoint, emails are entered as a 2D array.

Meeting Time Partial Request Example

{
"duration_minutes": 30,
"start_time": 1600890568,
"end_time": 1600999200,
"interval_minutes": 10,
"emails": [
"tom@brightideas.com",
"jane@brightideas.com"
],
...
{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
["swag@nylas.com", 'kat@spacetech.com'],
['dorothy@spacetech.com']
],
...

Checking Multiple Emails
You can pass in up to 50 emails. Since this endpoint uses synchronous requests (one email at a time), this can slow down response times with large requests. You should also keep your provider rate limits in mind.

Free Busy

To check availability for emails not in your organization, you can add them to the free_busy array. Each email address and time slot is its own object. This means if you want to add different busy times for the same email address, you need to add another object for that email address.

Free/Busy works like the free/busy endpoint. You need to know the times the email address outside of your organization is busy. You input these as the start and end times.

Free/Busy is optional for /calendar/availability and /calendar/consecutive/availability. It must still be included as an empty array when not in use.

Create free/busy times for both availability and consecutive availability using the request body:

  • free_busy - A dictionary of free/busy data for users not in your organization. Pass in the emails and times they are busy. Required as an empty array when checking meeting times in the same organization.
    • email - Email address of guests to check.
    • object - Always free/busy.
      • time_slots - Array containing the start and end times.
        • start_time - Unix timestamp for the beginning of the free/busy window.
        • end_time - Unix timestamp for the end of the free/busy window.
        • object - Always time_slot.
        • status - Always busy.

Free/Busy
Free/Busy is the same for /calendar/availability and /calendar/consecutive/availability.

Free/Busy Partial Request Example

...
"free_busy": [
{
"email": "marie@radioactivity.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601042400,
"end_time": 1601044200,
"object": "time_slot",
"status": "busy"
}
]
},
{
"email": "lamarr@player.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601042400,
"end_time": 1601044200,
"object": "time_slot",
"status": "busy"
}
]
},
{
"email": "lamarr@player.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601047800,
"end_time": 1601051400,
"object": "time_slot",
"status": "busy"
}
]
}
]
...
  "free_busy": [
{
"email": "tjperry07@gmail.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1605819600,
"end_time": 1605821400,
"object": "time_slot",
"status": "busy"
}
]
}
],
...

Open Hours

Open hours let you combine calendar availability with preferred availability. For example, meeting time will check for open times on the email’s calendar, and adding open hours lets you add additional unavailability.

When creating an open_hours object keep in mind:

  • Open Hours is optional for calendars/availability and calendars/consecutive/availability.
  • Emails added to open hours must all be in the meeting time emails array.
  • Emails not in the organization cannot use open_hours. They should be input using free_busy.

Create open hours for both availability and consecutive availability using the request body:

  • open_hours - Additional times email accounts are unavailable.
  • emails - Emails on the same domain to check. If you are using /calendar/availability it accepts an array of emails. If you are
    using calendar/consecutive/availability, it accepts a 2D array of
    emails.
  • days - The days the participants are not available entered as an integer. Monday corresponds to 0 and Sunday corresponds to 6.
  • timezone - IANA time zone database formatted string (e.g.
    America/New_York).
  • start - Start time in 24 time clock. Leading 0’s are left off. The minimum and maximum start time is 00:00.
  • end - End time in a 24 hour time clock. Leading 0’s are left off. The minimum and maximum end time is 00:00.
  • object_type - Always open_hours.

Open Hours

Open Hours is the same for /calendars/availability and /calendars/consecutive/availability.

...
"open_hours": [
{
"emails": [
"swag@nylas.com"
],
"days": [
"0"
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}
]
}
...
"open_hours": [
{
"emails": [
[
"swag@nylas.com"
]
],
"days": [
"0"
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}
]
}

Availability and Consecutive Availability Request

Now that you have gone through each section, you can see the final request for both end points.


{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
"swag@nylas.com"
],
"free_busy": [{
"email": "lamarr@player.com",
"object": "free/busy",
"time_slots": [{
"start_time": 1601042400,
"end_time": 1601044200,
"object": "time_slot",
"status": "busy"
}]
}],
"open_hours": [{
"emails": [
"swag@nylas.com"
],
"days": [
"0"
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}]
}

{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
[
"swag@nylas.com"
]
],
"free_busy": [
{
"email": "swag@nylas.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1605819600,
"end_time": 1605821400,
"object": "time_slot",
"status": "busy"
}
]
}
],
"open_hours": [
{
"emails": [
[
"string"
]
],
"days": [
"0"
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}
]
}

Availability Response

Once you make your POST request, each endpoint will return availability information.

  • Availability - Returns a list of time slots where all participants are available.
  • Consecutive Availability - Returns all possible groupings that share time slots. If only one person is available, it will return in the response. Use this information to schedule groups of people together for meetings.
{
"object": "availability",
"time_slots": [
{
"end": 1605803400,
"object": "time_slot",
"start": 1605801600,
"status": "free"
},
{
"end": 1605804000,
"object": "time_slot",
"start": 1605802200,
"status": "free"
},
{
"end": 1605804600,
"object": "time_slot",
"start": 1605802800,
"status": "free"
},
{
"end": 1605805200,
"object": "time_slot",
"start": 1605803400,
"status": "free"
},
{
"end": 1605805800,
"object": "time_slot",
"start": 1605804000,
"status": "free"
},
{
"end": 1605806400,
"object": "time_slot",
"start": 1605804600,
"status": "free"
},
{
"end": 1605807000,
"object": "time_slot",
"start": 1605805200,
"status": "free"
},
{
"end": 1605816000,
"object": "time_slot",
"start": 1605814200,
"status": "free"
}
]
}
[
[
{
"emails": [
"kat@spacetech.com",
"dorothy@spacetech.com"
],
"end_time": 1605794400,
"start_time": 1605792600
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605796200,
"start_time": 1605794400
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605801600,
"start_time": 1605799800
},
{
"emails": [
"kat@spacetech.com",
"dorothy@spacetech.com"
],
"end_time": 1605803400,
"start_time": 1605801600
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605802200,
"start_time": 1605800400
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605804000,
"start_time": 1605802200
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605802800,
"start_time": 1605801000
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605804600,
"start_time": 1605802800
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605803400,
"start_time": 1605801600
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605805200,
"start_time": 1605803400
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605803400,
"start_time": 1605801600
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605805200,
"start_time": 1605803400
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605804000,
"start_time": 1605802200
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605805800,
"start_time": 1605804000
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605804000,
"start_time": 1605802200
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605805800,
"start_time": 1605804000
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605804600,
"start_time": 1605802800
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605806400,
"start_time": 1605804600
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605804600,
"start_time": 1605802800
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605806400,
"start_time": 1605804600
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605805200,
"start_time": 1605803400
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605807000,
"start_time": 1605805200
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605805200,
"start_time": 1605803400
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605807000,
"start_time": 1605805200
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605811200,
"start_time": 1605809400
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605813000,
"start_time": 1605811200
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605811800,
"start_time": 1605810000
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605813600,
"start_time": 1605811800
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605812400,
"start_time": 1605810600
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605814200,
"start_time": 1605812400
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605813000,
"start_time": 1605811200
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605814800,
"start_time": 1605813000
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605813000,
"start_time": 1605811200
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605814800,
"start_time": 1605813000
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605813600,
"start_time": 1605811800
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605815400,
"start_time": 1605813600
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605813600,
"start_time": 1605811800
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605815400,
"start_time": 1605813600
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605814200,
"start_time": 1605812400
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605816000,
"start_time": 1605814200
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605814200,
"start_time": 1605812400
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605816000,
"start_time": 1605814200
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605814800,
"start_time": 1605813000
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605816600,
"start_time": 1605814800
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605815400,
"start_time": 1605813600
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605817200,
"start_time": 1605815400
}
],
[
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605816000,
"start_time": 1605814200
},
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605817800,
"start_time": 1605816000
}
],
[
{
"emails": [
"dorothy@spacetech.com"
],
"end_time": 1605826800,
"start_time": 1605825000
},
{
"emails": [
"kat@spacetech.com"
],
"end_time": 1605828600,
"start_time": 1605826800
}
]
]

Learn More

Review the Availability APIs.

Virtual Calendars

To use Virtual Calendars with Calendar Availability, pass in any events, busy time slots, or times you don't want booked from the Virtual Calendar to the free_busy object.

Learn More

Check out our guide on Virtual Calendar availability.

Availability Examples

Use these examples as a quick reference when making calendar availability requests.

Check Availability in Same Organization

  • free_busy is required as an empty array.
  • /calendars/availability/consecutive requires emails to be entered as a 2D array.
{
"duration_minutes": 30,
"start_time": 1600890568,
"end_time": 1600999200,
"interval_minutes": 10,
"emails": [
"tom@brightideas.com",
"jane@brightideas.com"
],
"free_busy": []
}
{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
["dorothy@spacetech.com"],
["kat@spacetech.com"]
],
"free_busy": []
}

Check Availability for Accounts Outside the Organization

{
"duration_minutes": 30,
"start_time": 1601042400,
"end_time": 1601085600,
"interval_minutes": 10,
"emails": [
"tom@brightideas.com",
"jane@brightideas.com"
],
"free_busy": [
{
"email": "marie@radioactivity.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601042400,
"end_time": 1601044200,
"object": "time_slot",
"status": "busy"
}
]
},
{
"email": "lamarr@player.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601042400,
"end_time": 1601044200,
"object": "time_slot",
"status": "busy"
}
]
},
{
"email": "lamarr@player.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1601047800,
"end_time": 1601051400,
"object": "time_slot",
"status": "busy"
}
]
}
]
}
{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
["dorothy@spacetech.com"],
["kat@spacetech.com"]
],
"free_busy": [
{
"email": "charlie@turing-complete.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1605819600,
"end_time": 1605821400,
"object": "time_slot",
"status": "busy"
}
]
}
]
}

Check Availability with Open Hours

  • Accounts outside the organization are entered in the free_busy array.
  • /calendars/availability/consecutive requires emails to be entered as a 2D array.
  • Open hours are optional when checking availability.
{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
"dorothy@spacetech.com",
"kat@spacetech.com",
"mary@spacetech.com"
],
"free_busy": [
{
"email": "ada@algoprime.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1605819600,
"end_time": 1605821400,
"object": "time_slot",
"status": "busy"
}
]
}
],
"open_hours": [
{
"emails": [
"dorothy@spacetech.com",
"kat@spacetech.com",
],
"days": [
0,
1,
2,
3,
4,
5,
6
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}
]
}
{
"duration_minutes": 30,
"start_time": 1605794400,
"end_time": 1605826800,
"interval_minutes": 10,
"emails": [
["dorothy@spacetech.com"],
["kat@spacetech.com"]
],
"free_busy": [
{
"email": "ada@algoprime.com",
"object": "free_busy",
"time_slots": [
{
"start_time": 1605819600,
"end_time": 1605821400,
"object": "time_slot",
"status": "busy"
}
]
}
],
"open_hours": [
{
"emails": [
"kat@spacetech.com"
],
"days": [
0,
1,
2,
3,
4,
5,
6
],
"timezone": "America/Chicago",
"start": "10:00",
"end": "14:00",
"object_type": "open_hours"
}
]
}

Check for Free/Busy

  • Can only check accounts within your organization.
{
"start_time":"1600890568",
"end_time":"1600999200",
"emails": ["swag@nylas.com"]
}{
"start_time":"1600890568",
"end_time":"1600999200",
"emails": ["swag@nylas.com"]
}

Comparison of Availability Endpoints

If you are not sure which to use, review the functionality of the endpoint.

When to Use Availability

  • Need to check availability for multiple participants and organize
    itineraries.
  • Some participants are outside your organization.
    • You will need to know when they are busy.
  • Need to check for specific event duration and intervals. You want to set additional unavailable times that are not on the calendar.

When to Use Free or Busy

  • Only need to check one email address.
  • The account is added to your Nylas application. Free/Busy can only check accounts within your organization.
  • You only need to know if someone is busy and don’t need to know if their schedule aligns with another email address.

Feature Support

Endpoint Scopes Provider Availability SDK Support Feature Availability
Availability calendar
calendar.read_only
Microsoft
Google
Python - Open Hours is not supported. Availability does support Room Resources. Just treat it as an email address when checking availability.
Consecutive Availability calendar
calendar.read_only
Microsoft
Google
None Consecutive Availability does support Room Resources. Just treat it as an email address when checking availability.
Free/Busy calendar
calendar.read_only
Microsoft
Google
Python
Java
Node
Free/Busy does not support Virtual Calendars.

Free/Busy does not support Room Resources.

What's Next?