• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Troubleshooting Empty Results from FusionAuth User Search API

Scheduled Pinned Locked Moved Solved
Frequently Asked Questions (FAQ)
search
1
2
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W
    wesley
    last edited by 15 Mar 2025, 20:25

    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?

    W 1 Reply Last reply 15 Mar 2025, 20:31 Reply Quote 0
    • W
      wesley @wesley
      last edited by 15 Mar 2025, 20:31

      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:

      • Elasticsearch Search in FusionAuth
      • User Search with Elasticsearch
      1 Reply Last reply Reply Quote 0
      • W wesley has marked this topic as solved on 15 Mar 2025, 20:31
      • M mark.robustelli moved this topic from Q&A on 27 Mar 2025, 22:41
      1 out of 2
      • First post
        1/2
        Last post