The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
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.