Troubleshooting Empty Results from FusionAuth User Search API
-
I'm trying to retrieve a list of all users stored in FusionAuth using the /api/user/search endpoint but keep getting empty results.
To troubleshoot, I tested the request in Postman, sending a POST request to /api/user/search with the following body:{ "search": { "queryString": "email@email.com" } }
However, the response I receive is:
{ "expandable": [], "total": 0, "users": [] }
Am I doing something wrong? Is there a better guide on how to format and send this request correctly?
-
Your request body looks correct for a basic search by email and should return a result if a user with that exact email address exists in your system.
1. Ensure You Are Using POST (or Use GET with Query Parameters)
- The /api/user/search endpoint supports both POST and GET, but they expect different input formats.
If using GET, you must provide query parameters, such as:
GET /api/user/search?ids=<user_id>
2. Searching for Partial Matches
If you want to find all users with a certain email domain, try using a wildcard search:
{ "search": { "queryString": "*@email.com" } }
3. Verify API Key Permissions
If you still get empty results, ensure that:
- Your API key has sufficient permissions to query user data.
- The user records exist in the database.
4. Further Reading on User Search
For more details on how to construct search queries, refer to:
-
-
M mark.robustelli moved this topic from Q&A