Share via

Is there a Microsoft / Sharepoint API that returns number of Sharepoint seats OR number of total users?

Test MS786 0 Reputation points
2026-04-02T22:57:35.65+00:00

I'm looking for a way to deterministically figure out what the rate limit of a Sharepoint instance is.

I know rate limit is determined by https://dori-uw-1.kuma-moon.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online

But what's the fastest way from API side (NOT via Entra or Admin UI) to find # seats or total number of users.

Im aware of user list, but that would require pagination and many calls to the API which is an expensive operation

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

2 answers

Sort by: Most helpful
  1. Teddie-D 14,070 Reputation points Microsoft External Staff Moderator
    2026-04-03T00:22:20.6666667+00:00

    Hi @Test MS786 

    Currently, there isn’t a Microsoft or SharePoint API that directly returns the number of SharePoint‑licensed users or a deterministic rate limit for a tenant. 

    SharePoint Online throttling is dynamic and is enforced at multiple scopes (user, application, and tenant). Although some tenant‑level limits are internally scaled based on total licensed user count, Microsoft does not expose this value via SharePoint or workload APIs, nor does it provide a way to calculate rate limits deterministically. 

    From an API perspective, the closest approximation you can get for tenant size is through Microsoft Graph: 

    -You can retrieve the total number of directory user objects without pagination:

    GET https://graph.microsoft.com/v1.0/users/$count  
    ConsistencyLevel: eventual 
    

    This provides a fast count of users, but it does not represent licensed users and is not a reliable indicator of SharePoint throttling behavior.

    -You can also query:

    GET https://graph.microsoft.com/v1.0/subscribedSkus 
    

    From the response via Microsoft Graph, you will get: 

    -skuPartNumber > License name 

    -prepaidUnits.enabled > Total purchased licenses 

    -consumedUnits > Assigned licenses 

    This can serve as a rough proxy for tenant scale, but it does not directly reflect the number of active SharePoint users, nor does it determine throttling limits. 

    The recommended approach is to handle throttling dynamically by: 

    -Monitoring HTTP 429 responses 

    -Respecting the Retry-After header 

    -Implementing retry and backoff logic with adaptive concurrency 

    This aligns with Microsoft’s guidance for both SharePoint Online and Microsoft Graph, which explicitly requires applications to react to throttling signals at runtime rather than attempting to pre‑compute limits. 

    I hope this helps clarify the expected behavior. 


    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.  


  2. Q&A Assist
    2026-04-02T22:57:51.1533333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    SharePoint Online throttling limits are documented as depending on the tenant license count, but the provided context does not contain any API or programmatic method to retrieve “number of seats” or “total users” directly from SharePoint or Microsoft 365 for the purpose of calculating those limits.

    The throttling article only describes how limits scale with license count and how to react to throttling (for example, by honoring Retry-After and using the IETF RateLimit-* headers when available), not how to query the license count:

    • User-level limits (for example, 3,000 requests per 5 minutes per user).
    • Tenant-level limits based on license bands (for example, 0–1,000, 1,001–5,000, etc.).
    • Application limits expressed in resource units, with guidance to estimate request rates and to prefer Microsoft Graph over CSOM/REST where possible.

    The same documentation recommends using the RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers (when present) and the Retry-After header to dynamically adapt request volume instead of trying to pre‑compute exact limits from license counts.

    Within the provided material there is no supported API described that returns tenant “seats” or total user count from SharePoint or Microsoft 365.


    References:

    0 comments No comments

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.