Search for Group Members

This API has been available since 1.36.0

The Group Member Search API allows you to search for Group Members with a paginated response.

Request#

API Key Authentication
Search for all Group Members by Group Id
GET/api/group/member/search?groupId={groupId}

When calling the API using a GET request you will send the search criteria on the URL using request parameters. In order to simplify the example URL above, only the groupId parameter is shown, however you may add any of the documented request parameters to the URL.

Request Parameters#

groupIdUUIDoptional

The unique Id of the Group used to search for Group Members.

numberOfResultsIntegeroptionalDefaults to 25

The number of results to return from the search.

orderByStringoptionalDefaults to insertInstant ASC, userId ASC, groupId ASC

The database column to order the search results on plus the order direction.

The possible values are:

  • groupId - the unique Id of the Group
  • id - the id of the Group Member
  • insertInstant - the instant when the Group Member was created
  • userId - the unique Id of the User

For example, to order the results by the insert instant in descending order, the value would be provided as insertInstant DESC. The final string is optional, can be set to ASC or DESC, or omitted and will default to ASC.

Prior to version 1.52.0 this defaults to insertInstant ASC.

startRowIntegeroptionalDefaults to 0

The offset row to return results from. If the search has 200 records in it and this is 50, it starts with row 50.

userIdUUIDoptional

The unique Id of the User to search for Group Members. A single user may belong to one or more Groups, so searching on this field may still produce multiple results.


API Key Authentication
Search Group Members using the given search criteria
POST/api/group/member/search
OpenAPI Spec

When calling the API using a POST request you will send the search criteria in a JSON request body.

Request Body#

search.groupIdUUIDoptional

The unique Id of the Group used to search for Group Members.

search.numberOfResultsIntegeroptionalDefaults to 25

The number of results to return from the search.

search.orderByStringoptionalDefaults to insertInstant ASC, userId ASC, groupId ASC

The database column to order the search results on plus the order direction.

The possible values are:

  • groupId - the unique Id of the Group
  • id - the id of the Group Member
  • insertInstant - the instant when the Group Member was created
  • userId - the unique Id of the User

For example, to order the results by the insert instant in descending order, the value would be provided as insertInstant DESC. The final string is optional, can be set to ASC or DESC, or omitted and will default to ASC.

Prior to version 1.52.0 this defaults to insertInstant ASC.

search.startRowIntegeroptionalDefaults to 0

The offset row to return results from. If the search has 200 records in it and this is 50, it starts with row 50.

search.userIdUUIDoptional

The unique Id of the User to search for Group Members. A single user may belong to one or more Groups, so searching on this field may still produce multiple results.

Response#

Response Codes
CodeDescription
200The request was successful. The response will contain a JSON body.
400The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
500There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

Response Body#

membersArray

A list of the Group Members that matched the search criteria.

members[x].dataObject

An object that can hold any information about the Group Member that should be persisted.

members[x].groupIdUUID

The unique Group Id that indicates the Group this membership represents.

members[x].idUUID

The unique Id of this Group Member.

members[x].insertInstantLong

The instant that this membership was created.

members[x].userIdUUID

The unique User Id that represents the User this membership represents.

totalInteger

The total number of Group Members matching the search criteria. Use this value along with the numberOfResults and startRow in the Search request to perform pagination.

Example Response JSON

{
  "members": [
    {
      "id": "47ffe8c2-920a-49cc-bfa8-b84889db615e",
      "groupId": "1188edfc-cef3-4555-910e-181ddf6153c0",
      "insertInstant": 1503513015493,
      "userId": "00000000-0000-0001-0000-000000000000"
    }
  ],
  "total": 1
}