groupsPage()

API Stability Long-Term

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

For information for a specific group, you can use the group() query field or the groupByDisplayName().

For more information on user groups, see the Manage Groups documentation page.

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 Datatype section for more possibilities.

Example

The example below queries LogScale with this query field:

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
      }
    }
  }
}

Given Datatype

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

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in 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 Datatype

For the return datatype, through the special datatype (i.e., Group), you can get information on each group, including information on users, permissions, and roles. You'll have to click on the link for that datatype to see the sub-parameters.

Table: GroupPage

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in 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.