Error fetching users from Microsoft Entra ID: "$top query has been exceeded"

Rishabh 0 Reputation points
2025-04-20T21:34:53.4633333+00:00

Hello everyone!

I'm integrating a Microsoft Entra ID application with a web app I'm building. The initial connection between the app and Entra ID is working fine. However, when I try to fetch the list of users via the Graph API, I get the following error:

{
  "message": "The query specified in the URI is not valid. The limit of '0' for Top query has been exceeded. The value from the incoming request is '100'.: Bad Request",
  "statusCode": 400,
  "error": "Bad Request" 
}

From what I understand, this might be related to the $top query parameter being disallowed or restricted, but I'm unsure how to resolve this. Has anyone encountered this before, or know what configuration might be missing in Entra or the app registration?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Venkata Jagadeep 1,325 Reputation points Microsoft External Staff Moderator
    2025-04-21T11:46:17.67+00:00

    Hello Rishabh,

    As per the description, we understand that you have configured Entra-ID App Registration with your web app and when fetching the list of users via Graph API, it is showing the error.

    The error states the limit of '0' for your query has been exceeded and it is related to $top parameter that is restricting to show results.

    The $top parameter allows you to limit the number of records that are returned.

    Please confirm if you have added value as '0' for $top parameter?

    For example, the below Graph command will provide the list of all users

    https://graph.microsoft.com/v1.0/users

    The below Graph command will show only top 5 users

    https://graph.microsoft.com/v1.0/users?$top=5

    But, if you give $top=0, then it cannot show the results as the count is set to '0'.

    Please refer the below document to understand the list of permissions for graph to access users list in the tenant.

    https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#permissions

    0 comments No comments

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.