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

    Is there a way to get all the members of a particular group?

    Scheduled Pinned Locked Moved
    Q&A
    groups search
    1
    2
    11.3k
    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.
    • danD
      dan
      last edited by

      Anyone know if there is a way to GET all of the members of a particular group? Looking at https://fusionauth.io/docs/v1/tech/apis/groups#add-users-to-a-group I only see Create/Delete.

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        You need to use the user search API with an elastic search query string.

        Here's a curl example:

        API_KEY=....
        GROUP_ID=f4a64b10-1cf6-4289-84c0-c3035f3b78bc
        
        curl -H "Authorization: $API_KEY" 'http://localhost:9011/api/user/search/?queryString=memberships.groupId:'$GROUP_ID 
        

        If you are using the database search engine, you cannot find all the members of a group.

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post