Preemptive rate limit headers missing from response from Graph API query

Rick Huang 61 Reputation points
2022-09-09T15:25:06.227+00:00

Hello,

We've received a few 429s with Retry-After headers indicating hitting a rate limit after an API call. We found several documentation pages mentioning headers that get returned in responses prior to the 429 that can help identify incoming rate limiting:

x-ms-throttle-limit-percentage: https://learn.microsoft.com/en-us/graph/throttling-limits#regular-responses-requests
RateLimit-*: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#ratelimit-headers---preview

However, we seem to hit the 429 rate limits before ever seeing any of these headers in the responses leading up to the rate limit-- we would have expected when we get close to the quota limit to receive these rate limits.

Under what exact conditions can we expect to see these headers returned before hitting the rate limit?

One example query that hit the rate limit-- client-request-id: 0786e6ff-15e7-497b-b507-0f04d905e111, request was made to list drives for a specific site, expanding the "list" attribute.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Srinivasa Rao Darna 6,761 Reputation points Microsoft External Staff
    2022-09-12T15:36:51.263+00:00

    Hi @Rick Huang ,

    As documentation suggests RateLimit headers are currently under preview release only,

    • These headers are currently in beta and subject to change, if applications to take advantage of these headers to avoid hitting throttle, have to make use of https://graph.microsoft.com/beta APIs.
    • The RateLimit headers are returned on a best-efforts basis, so applications may not receive the headers under all conditions.
    • When an application consumes 80% or more of its app 1 minute limit, the RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset are returned.
    • There are other limits that aren't presented in the RateLimit headers, so applications can get throttled even before reaching the limit described in the RateLimit headers and thus don't see these headers in your response.

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


0 additional answers

Sort by: Most helpful

Your answer

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