microsoft graph api recurring events

Master Microsoft Graph API: Working with Recurring Events

By Sarah Garcia
AD

The Microsoft Graph API, a RESTful web API that connects to Microsoft Cloud service resources, offers a powerful way to access and interact with data across various Microsoft 365, Windows 10, and Enterprise Services. Among its extensive capabilities is the ability to manage recurring events, providing a robust solution for calendar applications and services.

Whether you're a developer building a calendar app or an admin managing team schedules, understanding and leveraging the Microsoft Graph API for recurring events can significantly streamline your workflows. In this article, we'll delve into the intricacies of the Microsoft Graph API's recurring events, exploring its functionalities and practical applications.

Understanding Recurring Events in Microsoft Graph API

In the Microsoft Graph API, recurring events allow you to schedule regular, repeating events in a calendar. They are defined by a set of rules that determine when and how the event repeats.

AD
Using Microsoft Graph API inside Microsoft Flow in O365
Using Microsoft Graph API inside Microsoft Flow in O365
Microsoft touts LinkedIn, Graph API and AI foundations of its new Bing ad service
Microsoft touts LinkedIn, Graph API and AI foundations of its new Bing ad service
Microsoft's extensible Graph API can turn any device into a productivity tool
Microsoft's extensible Graph API can turn any device into a productivity tool

Microsoft Graph API supports the iCalendar RFC 5545 standard for recurring events, enabling seamless interoperability with other calendar applications and services. This standard defines a pattern that specifies when an event repeats, such as daily, weekly, or annually, and any exceptions to the pattern, like single occurrences or changes to the recurring rule.

Recurring Event Pattern

The recurring event pattern in Microsoft Graph API is defined using the `recurrence` property of an event. This property is an object with several sub-properties that determine the recurrence pattern. The most common ones are:

Support Tip: Getting Started with Microsoft Graph API | Microsoft Community Hub
Support Tip: Getting Started with Microsoft Graph API | Microsoft Community Hub
Introducing the new Microsoft Graph Security API add-on for Splunk! | Microsoft Community Hub
Introducing the new Microsoft Graph Security API add-on for Splunk! | Microsoft Community Hub
How To Read Microsoft Outlook Calendars with Python
How To Read Microsoft Outlook Calendars with Python
  • freq: The recurrence frequency (e.g., daily, weekly, etc.).
  • interval: The interval between each recurrence (e.g., 2 for every other day).
  • count: The number of times the event will recur (e.g., 10 for 10 occurrences).
  • endDateTime: The date and time when the recurrence will end (inclusive).
  • type: The type of recurrence (e.g., occurrence for counting the number of occurrences, infinite for unlimited occurrences).

For example, the following `recurrence` object represents a weekly event that occurs every Sunday for 10 weeks:

{
  "recurrence": {
    "freq": "weekly",
    "interval": 1,
    " Countess": 10,
    "type": "occurrence"
  }
}

Recurring Event Exceptions

Microsoft Graph API allows you to add exceptions to a recurring event, overriding the recurrence pattern for a specific occurrence. Exceptions can be added, changed, or removed using the `/exceptions` endpoint. They can also be part of the event object, defined in the `exceptions` property.

AD

Here's an example of adding an exception to cancel a recurring event on a specific date:

How to Use Microsoft Graph API in SPFx Web Parts
How to Use Microsoft Graph API in SPFx Web Parts
a flow diagram showing the steps to an event streaming platform and how it is used
a flow diagram showing the steps to an event streaming platform and how it is used
How to Use Microsoft's Graph API to Query, Create and Analyze Data from OneDrive, Outlook and more | Towards Data Science
How to Use Microsoft's Graph API to Query, Create and Analyze Data from OneDrive, Outlook and more | Towards Data Science
a diagram showing the different types of webbooks and apis, with text below
a diagram showing the different types of webbooks and apis, with text below
GraphQL API vs. REST API (Visual Architecture) 🌐
GraphQL API vs. REST API (Visual Architecture) 🌐
GRAPHQL VS REST API (2026)
GRAPHQL VS REST API (2026)
PATCH https://graph.microsoft.com/v1.0/me/events/{id}/exceptions/{id}
Content-Type: application/json

{
  "status": {
    "code": "canceled"
  }
}

Managing Recurring Events in Microsoft Graph API

Microsoft Graph API provides various endpoints to create, update, delete, and retrieve recurring events, including those that leverage the `recurrence` property and exceptions.

Creating Recurring Events

To create a new recurring event, send a POST request to the `/me/events` or `/users/{id | userPrincipalName}/events` endpoint with the appropriate event object, including the `recurrence` property. Here's an example:

AD
POST https://graph.microsoft.com/v1.0/me/events
Content-Type: application/json

{
  "subject": "Test Event",
  "startDateTime": "2022-01-01T09:00:00",
  "endDateTime": "2022-01-01T10:00:00",
  "recurrence": {
    ...
  }
}

Updating Recurring Events

To update an existing recurring event, send a PATCH or DELETE request to the appropriate event endpoint. You can update the `recurrence` property to modify the recurrence pattern or add, change, or remove exceptions.

Seven Things That Break Your API Only When Users Actually Show Up
Seven Things That Break Your API Only When Users Actually Show Up

When updating recurring events, it's essential to consider the impact on existing occurrences. Microsoft Graph API provides options like `sendInvitations` and `preferredStartDateTime` to control how updates are applied to the event and its occurrences.

Embracing the Microsoft Graph API for managing recurring events can help you achieve more efficient and automated calendar management. Whether you're a developer integrating calendar functionality into your application or an admin streamlining team schedules, the power and flexibility of Microsoft Graph API's recurring events are at your fingertips.

AD

Stay ahead of the curve by exploring and leveraging the ever-evolving capabilities of the Microsoft Graph API. Happy coding, and until next time!

AD