Share via

Microsoft Graph API 5006 Error Code - Can't View Users Calendar (getSchedule) and can't find problem calendar entries

Wesley O'Hara 20 Reputation points
2025-10-06T21:00:49.8833333+00:00

I have this issue where when I try to use this Graph API: POST /users/{id|userPrincipalName}/calendar/getSchedule
With any length time slot (availabilityViewInterval) over any viable amount of time (startTime and endTime), I get this error message:

error": {
                "message": "The result set contains too many calendar entries.",
                "responseCode": "5006"
            }

Except when I look at the user's calendar using the /events Graph API, I don't see any obviously duplicated events or an obnoxious amount of calendar entries that would be considered 'too many.' Using the GET /events Graph API, there is well under the 1000 events in the same time slot that fails for the above API. Odd behavior I can't find any answers for online. There are a few accounts in my organization that have this same behavior. This is the API that is successful for me: https://graph.microsoft.com/v1.0/users/{email}/events?$filter=start/dateTime ge '2025-10-06T08:00'&top=1000&$count=true

The user can view their own calendar no problem, but no one else can view their calendar for scheduling.

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Teddie-D 16,130 Reputation points Microsoft External Staff Moderator
    2025-10-07T03:29:06.1066667+00:00

    Hi @Wesley O'Hara 

    Thank you for posting your question in the Microsoft Q&A forum. 

    Based on this Microsoft documentation, the error you’re seeing "The result set contains too many calendar entries." is a known limitation of the getSchedule API in Microsoft Graph. This typically occurs when the requested time window combined with a small availabilityViewInterval results in an excessive number of time slots, especially when recurring events are involved. 

    For example, a 30-day window with a 5-minute interval generates: 

    (30 days × 24 hours × 60 minutes) ÷ 5 = 8,640 slots 

    Even if a user has only a few dozen events, recurring series (like daily meetings) can expand into hundreds of instances. The API attempts to map each occurrence across all time slots, which can easily exceed the 1,000-entry limit. 

    Here are some workarounds you can try: 

    -Reduce the time range: Instead of querying a full month, try limiting the request to 1–7 days. 

    -Increase availabilityViewInterval: Use 30 or 60 minutes instead of 5 or 10 to reduce the number of slots. 

    -Break the request into smaller chunks: Consider querying availability in daily or weekly segments. 

    It's important to note that getSchedule expands recurring events into individual instances for availability calculations. A single recurring meeting (e.g., daily for a year) can result in hundreds of entries. 

    To identify potentially problematic recurring series, you can query the /events endpoint with a filter: 

    $filter=type eq 'seriesMaster'
    

    This will help you locate recurring events that may be contributing to the overload. 

    I hope this helps clarify the issue and guide you toward a workable solution. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.