Summary

The groupsPage() GraphQL query returns all of the groups in an organization. You can limit results based on search text.

API Stability Long-Term

Syntax

graphql
groupsPage(
     search: string,
     pageSize: integer!,
     pageNumber: integer!,
     typeFilter: [PermissionType]
   ): GroupPage!

For the input, you're required only to provide how many records you want per page, and the page on which you want to start. You can use the search parameter to give text on which to search the names of groups. You'd use the typeFilter to narrow the results to a particular permission type (e.g., ViewPermission).

For the results, through a sub-parameter, you can get information on each group, including information on users, permissions, and roles. See the Returned Values section for more possibilities.

Example

Raw
graphql
query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "query{ ^
  groupsPage( ^
    pageSize: 10 ^
    pageNumber: 1 ^
  ) { ^
    page { ^
      id, displayName, userCount ^
    } ^
    pageInfo { ^
      number ^
      totalNumberOfRows ^
      total ^
    } ^
  } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "query{
  groupsPage(
    pageSize: 10
    pageNumber: 1
  ) {
    page {
      id, displayName, userCount
    }
    pageInfo {
      number
      totalNumberOfRows
      total
    }
  }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "groupsPage": {
      "page": [
        {
          "id": "BHdJstvjgDUjXg10KrbjiybpSbOHIw1b",
          "displayName": "chiefs",
          "userCount": 3
        },
        {
          "id": "frkEfzhGfwirpfrtLJ6QSW6ZoLqy5ZDI",
          "displayName": "peons",
          "userCount": 1
        }
      ],
      "pageInfo": {
        "number": 1,
        "totalNumberOfRows": 2,
        "total": 2
      }
    }
  }
}

Input Parameters

For the input, you would give the number of results to include in a page — for the paginated results — and which page to return based on the size of pages. You may also limit results to groups that match a search string, and the type of permission (see second table below).

Table: Input Parameters & Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this query. Since one of the parameters uses a special datatype, an additional table is included below with its parameters.
pageNumber integer yes   The number of the page for which to return results.
pageSize integer yes   The number of results per page.
search string     Text on which to search group names.
typeFilter [PermissionType]     The type of permission. See table below.

With the one given datatype, you can narrow the results returned by the query to groups that allow access to particular permission types. The table below lists your choices:

Table: PermissionType Enum Datatype

ParameterTypeRequiredDefaultStabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results.
Table last updated: Oct 3, 2025
AssetPermission   Long-TermThe type of permission is related to assets.
OrganizationManagementPermission   Long-TermThe permission is for the management of an organization.
OrganizationPermission   Long-TermThe permission is based on an organization.
SystemPermission   Long-TermThe permission is for the system.
ViewPermission   Long-TermThe permission is for a view.

Returned Values

For the results, you can get information on each group, including information on users, permissions, and roles.

Table: GroupPage Datatype

ParameterTypeRequiredDefaultStabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results.
Table last updated: Sep 25, 2024
page[Group]yes Long-TermA list of groups. See Group.
pageInfoPageTypeyes Long-TermInformation about the group page. See PageType.

The datatype above uses another datatype for group information. For your convenience, the table for that sub-datatype is included here:

Table: Group Datatype

ParameterTypeRequiredDefaultStabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results.
Table last updated: Sep 11, 2025
allowedAssetActionsBySource(assetId: string, assetType: AssetPermissionsAssetType, searchDomainId: string): GroupAssetActionsBySourcemultipleyes PreviewGet allowed asset actions for the group on a specific asset and explain how it has gotten this access. See AssetPermissionsAssetType GroupAssetActionsBySource.
defaultQueryPrefixstring  Long-TermThe default prefix for queries.
defaultRoleRole  Long-TermThe default role associated with the group. See Role.
defaultSearchDomainCountintegeryes Long-TermThe default search domain count.
displayNamestringyes Long-TermThe display name of the group.
idstringyes Long-TermThe identifier of the group.
lookupNamestring  Long-TermThe look-up name for the group.
organizationRoles[GroupOrganizationRole]yes Long-TermThe roles of the organization associated with the group. See GroupOrganizationRole.
permissionTypePermissionType  Long-TermIndicates which level of permissions the group contains. See PermissionType .
queryPrefixes(onlyIncludeRestrictiveQueryPrefixes: boolean, onlyForRoleWithId: string): [QueryPrefixes]multiple  Long-TermThe query prefixes for the group. See QueryPrefixes.
roles[SearchDomainRole]yes Long-TermThe roles for the group See SearchDomainRole.
searchAssetPermissions(searchFilter: string, skip: integer, limit: integer, orderBy: OrderBy, sortBy: SortBy, assetTypes: [AssetPermissionsAssetType], searchDomainIds: [string], permissions: [AssetAction], includeUnassignedAssets: boolean): AssetPermissionSearchResultSetmultipleyes Short-TermSearch for asset permissions for the group. This is a preview and subject to change. See AssetPermissionsAssetType AssetAction, and AssetPermissionSearchResultSet.
searchDomainCountintegeryes Long-TermThe number of search domains for the group.
searchDomainRoles(searchDomainId: string): [SearchDomainRole]multipleyes Long-TermThe search domain roles assigned to the group. See SearchDomainRole.
searchDomainRolesByName(searchDomainName: string): SearchDomainRolemultipleyes Deprecated

The search domain roles assigned to the group, by name. See SearchDomainRole. When multiple roles per view is enabled, this field will return only the first of possibly multiple roles matching the name for the view.

Use roles, searchDomainRoles, or searchDomainRolesBySearchDomainName fields instead. This field will be removed at the earliest in version 1.195.

searchDomainRolesBySearchDomainName(searchDomainName: string): [SearchDomainRole]multipleyes Long-TermThe domain roles by search domain name. See SearchDomainRole.
searchUsers(searchFilter: string, skip: integer, limit: integer, sortBy: OrderByUserField, orderBy: OrderBy): UserResultSetTypemultiple  Long-TermUsed to search the list of users in the group. See OrderByUserField , OrderBy , UserResultSetType.
systemRoles[GroupSystemRole]yes Long-TermThe system roles of the group. See GroupSystemRole.
userCountintegeryes Long-TermThe number of users that are part of the group.
users[User]yes Long-TermThe list of users in the group. See User.