Skip to content

You can use the group__sys and group_membership__sys query targets to query Vault group and user membership information. This allows you to retrieve, filter, and paginate over a large number of groups in your Vault. Groups are available for query in v18.3+ only.

For relationships between users and groups, both user__sys and group__sys objects have a group_membership_sysr "down" relationship that joins the user__sys and group__sys objects.

The group_membership_sys exposes the following parent relationships:

  • user__sysr relationship to the user__sys object.
  • group__sysr relationship to the group__sys object.

This metadata is only available via VQL query and cannot be retrieved using the standard metadata API.

The following fields are queryable for the group__sys object:

NameDescription
name__vThe group name. This field must be unique.
label__vUI label for the group. This field must be unique.
status__vThe current state of the group (Active or Inactive).
description__sysThe description of the group.
system_group__sysSpecifies if the group is editable. User-managed groups will have a value of false, while system-managed groups will have a value of true.
type__sysPoints to group_types__sys standard picklist.
created_date__vTimestamp when the group was created.
created_by__vID of a user who created the group.
modified_date__vTimestamp when the group was updated.
modified_by__vID of a user who updated the group.

This metadata is only available via VQL query and cannot be retrieved using the standard metadata API.

The following fields are queryable for the group_membership__sys object:

NameDescription
idThe group membership ID.
user_id__sysID of the user_sys object.
group_id__sysID of the group_sys object.

The following are examples of standard group queries.

Retrieve all user-managed groups:

SELECT id, name__v, label__v, type__sys FROM group__sys WHERE type__sys = 'user_managed__sys'

Retrieve all group IDs where user with ID 123 is a member:

SELECT group_id__sys FROM group_membership__sys WHERE user__sysr.id = 123

For all active users, retrieve the user-managed groups the user is a member of:

SELECT id, (SELECT group__sysr.name__v, group__sysr.label__v FROM group_membership__sysr WHERE group__sysr.type__sys = 'user_managed__sys') FROM user__sys WHERE status__v = 'active__v'

For each user-managed Approvers group, retrieve the active members:

SELECT id, (SELECT user_id__sys FROM group_membership__sysr WHERE user__sysr.status__v = 'active__v') FROM group__sys WHERE name__v = 'approvers__c' AND type__sys = 'user_managed__sys'

Retrieve the members of the group with the label 'All Product Experts':

SELECT user_id__sys, user__sysr.name__v, user__sysr.email__sys FROM group_membership__sys WHERE group__sysr.label__v = 'All Product Experts'

Retrieve the members of the group with the name all_product_experts__c:

SELECT user_id__sys, user__sysr.name__v, user__sysr.email__sys FROM group_membership__sys WHERE group__sysr.name__v = 'all_product_experts__c'

Retrieve the members of the group with the ID '1394917493501':

SELECT user_id__sys, user__sysr.name__v, user__sysr.email__sys FROM group_membership__sys WHERE group_id__sys = 1394917493501