Skip to main content

Find User Group Membership

Find relationships between users and groups. The command uses the PV_USER_GROUP_MEMBERSHIP public view to find data. Any filters passed should apply to this public view.

GET https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership

Request

Parameters

findUserGroupMembership
formatproperties - (Default) Returns the response as key=value pairs. When multiple objects are returned, values are comma-delimited: key=value1,value2,value3.

json - Returns the response as JSON.

csv - Returns the response as comma-separated values.

tsv - Returns the response as tab-separated values.

xml - Returns the response as XML.
delimiterThe delimiter to use between values for csv and properties formats
returnColumns

The names of the columns to return. returnColumns may be a CSV list of multiple column names. The parameter may also be listed multiple times (ie returnColumns=col1,col2&returnColumns=col3,col4)

Refer to Columns table below.
returnMaxRowsThe maximum number of objects to return
distincttrue, false Returns only distinct values, equivalent to the distinct keyword in SQL.
sortByColumns

The results will be sorted based on the columns listed using comma as the delimiter if multiple columns are specified.

Refer to Columns table below.
sortDirectionDetermines sorting order. asc for ascending, desc for descending. If not specified, the natural order returned by the database is used.
includeHeaderRowtrue, false Include column headers when the return format is csv or tsv. (Default) true
ignoreCasetrue, false Returns case-insensitive search results for specified filter parameters. (Default) false

Filter Parameters

Any column listed in the Columns table can be passed as a filter parameter to narrow results. Filters are matched against the PV_USER_GROUP_MEMBERSHIP public view.

Query logic

ScenarioBehavior
Two different parameters: group_id=52&member_derived_from_type=AccountAND. Returns Account-type members in group 52 only.
Same parameter repeated: group_id=52&group_id=55OR within that field. Returns members in group 52 or 55.
Mixed: member_derived_from_type=Account&group_id=52&group_id=55(member_derived_from_type is Account) AND (group_id is 52 or 55)
OR logic across different parameters is not supported

A single API call cannot return rows where group_id=52 OR member_derived_from_type=Account. OR logic between different filter parameters is not supported.

Workaround: Make separate requests for each filter condition. Merge and deduplicate the results client-side.

Columns

group_id[Foreign Key referencing the Group] ID of the group the user belongs to
user_id[Foreign Key referencing USERS.ID] User who is a member of the group
member_derived_from_typeHow the membership was derived. Known values: Account, Direct
member_derived_from_idID of the source object (e.g. account ID) from which membership was derived

Headers

Bearer token
Acceptapplication/json
Content-Typeapplication/json

Response

Parameters

The API returns the requested columns specified by returnColumns as output. If returnColumns is unspecified then all columns listed will be returned.

Examples

All columns

Omit returnColumns to return every field for each membership record.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=2" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "46341",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281134"
},
{
"group_id": "52",
"user_id": "46197",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281094"
}
]
}

Specific columns

Use returnColumns to limit the response to the fields you need.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type,member_derived_from_id" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "46341",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281134"
},
{
"group_id": "52",
"user_id": "46197",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281094"
},
{
"group_id": "52",
"user_id": "46193",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281395"
}
]
}

Filter by a single value

Pass any column name as a query parameter to filter results. The example returns memberships where member_derived_from_type is Account.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type,member_derived_from_id&member_derived_from_type=Account" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "46341",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281134"
},
{
"group_id": "52",
"user_id": "46197",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281094"
},
{
"group_id": "52",
"user_id": "46193",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281395"
}
]
}

Filter with OR logic

Repeat the same parameter with different values to match any of them. The example requests memberships where member_derived_from_type is Account or Direct.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type,member_derived_from_id&member_derived_from_type=Account&member_derived_from_type=Direct" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "46341",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281134"
},
{
"group_id": "52",
"user_id": "46197",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281094"
},
{
"group_id": "52",
"user_id": "46193",
"member_derived_from_type": "Account",
"member_derived_from_id": "2281395"
}
]
}

Case-insensitive filter

Filters are case-sensitive by default. Set ignoreCase=true to match regardless of case. The example passes member_derived_from_type=account in lowercase and still returns records with the stored value Account.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type&member_derived_from_type=account&ignoreCase=true" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "46341",
"member_derived_from_type": "Account"
},
{
"group_id": "52",
"user_id": "46197",
"member_derived_from_type": "Account"
},
{
"group_id": "52",
"user_id": "46193",
"member_derived_from_type": "Account"
}
]
}

Sort ascending

Use sortByColumns with a column name and sortDirection=asc to sort results from lowest to highest. The example sorts by group_id.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type&sortByColumns=group_id&sortDirection=asc" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "52",
"user_id": "3",
"member_derived_from_type": "Account"
},
{
"group_id": "52",
"user_id": "4",
"member_derived_from_type": "Account"
},
{
"group_id": "52",
"user_id": "7",
"member_derived_from_type": "Account"
}
]
}

Sort descending

Set sortDirection=desc to reverse the order.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=json&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type&sortByColumns=group_id&sortDirection=desc" \
-H "Authorization: Bearer <token>"

Response

{
"findUserGroupMembership": [
{
"group_id": "44601",
"user_id": "38328",
"member_derived_from_type": "Account"
},
{
"group_id": "44502",
"user_id": "36291",
"member_derived_from_type": "Account"
},
{
"group_id": "44320",
"user_id": "38328",
"member_derived_from_type": "Account"
}
]
}

CSV with custom delimiter

Set format=csv for a comma-separated response. Use delimiter to change the separator character.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=csv&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type&delimiter=~" \
-H "Authorization: Bearer <token>"

Response

group_id~user_id~member_derived_from_type
52~46341~Account
52~46197~Account
52~46193~Account

CSV without header row

Set includeHeaderRow=false when your downstream system expects raw data rows without a header.

Request

curl -K -X GET \
"https://instance.securid.com/aveksa/command.submit?cmd=findUserGroupMembership&format=csv&returnMaxRows=3&returnColumns=group_id,user_id,member_derived_from_type&includeHeaderRow=false" \
-H "Authorization: Bearer <token>"

Response

52,46341,Account
52,46197,Account
52,46193,Account

Error responses

A 401 is returned when the token is missing, invalid, or expired. A 412 is returned when returnColumns includes a column name that does not exist in the PV_USER_GROUP_MEMBERSHIP public view.

<html>
<head><title>Error</title></head>
<body>The token is not valid for the command 'findUserGroupMembership'. Token is invalid or expired</body>
</html>

Verified with RSA Governance & Lifecycle version 8.0.0.188886 P10_HF01.