Bookings
Nylas Scheduler uses the /v3/scheduling/bookings endpoint to manage bookings.
Booking types
Nylas Scheduler supports two booking types, booking and organizer-confirmation.
booking represents a regular booking flow. When the booking type is organizer-confirmation, Nylas creates an event marked "Pending" in the organizer's calendar. It then sends an confirmation request email to the organizer, which includes a link to a page where the organizer can confirm or cancel the booking.
Finalizing pending bookings
The PUT /v3/scheduling/bookings/{booking_id} request allows the organizer to confirm or cancel a pending booking.
Booking flow
The Scheduling Component provides information about the selected time slot, and any additional information that the user added, to the /v3/scheduling/bookings endpoint. The Bookings endpoint performs the following tasks:
- Validates the provided session ID and uses it to retrieve the related Configuration object.
- Confirms if the selected time slot is still available.
- Retrieves the booking participant's
grant_id, using the list of participants' email addresses in the Configuration object. - Creates an event.
If the booking type is set toorganizer-confirmation, a placeholder event is created in the organizer's calendar. - Creates a booking entry in the database and maps the provider's event ID and Scheduler's
booking_id. If the booking type is set toorganizer-confirmation, a booking entry with thependingstatus is created. The booking entry includes the placeholder event'sbooking_idand theadditional_fieldsdata provided in the request. - Nylas creates a booking reference based on the configuration ID and the booking ID. You can use the booking reference to reschedule and cancel the event.
- (Optional) Emits a booking (
booking.created) or a pending booking (booking.pending) webhook, depending on the booking type.
Bookings scopes
The table below lists the Bookings endpoints and which scopes they require. The table shortens the full scope URI for space reasons, so add the prefix for the provider when requesting scopes.
The ☑️ in each column indicates the most restrictive scope you can request for each provider and still use that API. More permissive scopes appear under the minimum option. If you're already using one of the permissive scopes, you don't need to add the more restrictive scope.
| Endpoint | Google Scopeshttps://www.googleapis.com/auth/... |
Microsoft Scopeshttps://graph.microsoft.com/... |
|---|---|---|
POST /scheduling/bookingsDELETE /scheduling/bookings/<BOOKING_ID>PATCH /scheduling/bookings/<BOOKING_ID> |
/calendar.events ☑️/calendar |
Calendars.ReadWrite ☑️ |
For more information about scopes, see Using scopes to request user data.
POST /v3/scheduling/bookingsBooks an event with the participants listed in the session's Configuration object, using the details from the Configuration. The start time and end time must correspond to a valid time slot returned b...
GET /v3/scheduling/bookings/{booking_id}Returns the specified Booking object. Nylas validates the provided session ID and uses it to retrieve the related Configuration object. If you created a public Configuration, you don't need to include...
PUT /v3/scheduling/bookings/{booking_id}Confirms or cancels the specified pending booking. Nylas also updates the associated event on the provider. Nylas validates the provided session ID and uses it to retrieve the related Configuration ob...
PATCH /v3/scheduling/bookings/{booking_id}Reschedules the specified booking. Nylas also updates the associated event on the provider. Nylas recommends against changing participants' email addresses while updating a booking, to avoid confusion...
DELETE /v3/scheduling/bookings/{booking_id}Deletes the specified booking. Nylas also cancels the associated event on the provider. Nylas validates the provided session ID and uses it to retrieve the related Configuration object. If you created...