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#
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#
groupIdUUIDoptionalThe unique Id of the Group used to search for Group Members.
numberOfResultsIntegeroptionalDefaults to 25The number of results to return from the search.
orderByStringoptionalDefaults to insertInstant ASC, userId ASC, groupId ASCThe database column to order the search results on plus the order direction.
The possible values are:
groupId- the unique Id of the Groupid- the id of the Group MemberinsertInstant- the instant when the Group Member was createduserId- 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 0The offset row to return results from. If the search has 200 records in it and this is 50, it starts with row 50.
userIdUUIDoptionalThe 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.
OpenAPI Spec
When calling the API using a POST request you will send the search criteria in a JSON request body.
Request Body#
search.groupIdUUIDoptionalThe unique Id of the Group used to search for Group Members.
search.numberOfResultsIntegeroptionalDefaults to 25The number of results to return from the search.
search.orderByStringoptionalDefaults to insertInstant ASC, userId ASC, groupId ASCThe database column to order the search results on plus the order direction.
The possible values are:
groupId- the unique Id of the Groupid- the id of the Group MemberinsertInstant- the instant when the Group Member was createduserId- 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 0The offset row to return results from. If the search has 200 records in it and this is 50, it starts with row 50.
search.userIdUUIDoptionalThe 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| Code | Description |
|---|---|
| 200 | The request was successful. The response will contain a JSON body. |
| 400 | The 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. |
| 401 | You 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. |
| 500 | There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty. |
Response Body#
membersArrayA list of the Group Members that matched the search criteria.
members[x].dataObjectAn object that can hold any information about the Group Member that should be persisted.
members[x].groupIdUUIDThe unique Group Id that indicates the Group this membership represents.
members[x].idUUIDThe unique Id of this Group Member.
members[x].insertInstantLongThe instant that this membership was created.
members[x].userIdUUIDThe unique User Id that represents the User this membership represents.
totalIntegerThe 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
}