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,
      pageNumber: Int!,
      pageSize: Int!,
      typeFilter: [PermissionType!]
   ): GroupPage!

Provide pageSize (required) and pageNumber (required, zero-indexed). Use search to filter groups by name substring. Use typeFilter to narrow results to groups that have a particular permission type (for example, ViewPermission).

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

Provide the number of results per page and the page number to return. Optionally limit results to groups that match a search string and a permission type (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 Int! yes   The number of the page for which to return results.
pageSize Int! 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:

Returned Values

Returns a non-nullable GroupPage object. The page field contains the list of Group objects for this page. The pageInfo field returns a PageType object with number (the current page number), totalNumberOfRows (the count of groups on this page), and total (the total group count across all pages — use this to calculate the number of pages required for a full traversal). Each Group in page carries identity, access control, and user membership fields; see the Group sub-table below.

Table: GroupPage Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
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 14, 2026 
pageGroupyes Long-Term A list of groups. See Group.
pageInfoPageTypeyes Long-Term Information about the group page. See PageType.

The GroupPage type contains Group objects. For reference, the Group datatype table is included here:

Table: Group Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
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 14, 2026 
assetIdString,yes   Id of the asset
assetTypeAssetPermissionsAssetType,searchDomainId:String):GroupAssetActionsBySourceyes Short-Term The type of the asset.
assetTypesAssetPermissionsAssetType],yes   List of asset types
defaultQueryPrefixString  Long-Term The default prefix for queries.
defaultRoleRole  Long-Term The default role associated with the group. See Role.
defaultSearchDomainCountIntyes Long-Term The default search domain count.
displayNameStringyes Long-Term The display name of the group.
idStringyes Long-Term The identifier of the group.
limitInt,    The amount of results to return.
lookupNameString  Long-Term The look-up name for the group.
orderByOrderBy):UserResultSetTypeyes Long-Term Choose the order in which the results are returned.
organizationRolesGroupOrganizationRoleyes Long-Term The roles of the organization associated with the group. See GroupOrganizationRole.
permissionTypePermissionType  Long-Term Indicates which level of permissions the group contains. See PermissionType .
permissionsAssetAction]):AssetPermissionSearchResultSetyes Short-Term Include Read, Update and/or Delete permission assignments. The filter will accept all assets if the argument Null or the empty list.
rolesSearchDomainRoleyes Long-Term The roles for the group See SearchDomainRole.
searchDomainCountIntyes Long-Term The number of search domains for the group.
searchDomainIdsString],yes   List of search domain id's to search within. Null or empty list is interpreted as all search domains
searchDomainRoles(searchDomainId: String)SearchDomainRoleyes Long-Term The search domain roles assigned to the group. See SearchDomainRole.
searchDomainRolesByName(searchDomainName: String!)SearchDomainRole  Deprecateddeprecated in 1.195

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!)SearchDomainRoleyes Long-Term The domain roles by search domain name. See SearchDomainRole.
searchFilterString,    Filter results based on this string
skipInt,    The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1)
sortByOrderByUserField,    The value to sort the result set by.
systemRolesGroupSystemRoleyes Long-Term The system roles of the group. See GroupSystemRole.
userCountIntyes Long-Term The number of users that are part of the group.
usersUseryes Long-Term The list of users in the group. See User.