Summary

The rolesPage() GraphQL query returns searchable paginated roles.

API Stability Long-Term

Syntax

graphql
rolesPage(
      search: String,
      pageNumber: Int!,
      pageSize: Int!,
      typeFilter: [PermissionType!],
      includeHidden: Boolean
   ): RolePage!

Filter roles by name with search. Use pageSize (required) and pageNumber (required) for pagination. See the Input Parameters section for details.

Returns a non-nullable RolePage object. See the Returned Values section for available fields.

Example

Raw
graphql
query {
  rolesPage(search: "member", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}
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 {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}"
}
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 {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}"
}
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 { ^
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1) ^
  {pageInfo {total, totalNumberOfRows}, page { ^
    id, displayName, usersCount, viewPermissions ^
  }} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}"
}'
    "$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 {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}";
$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 {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}"
}'''

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 {
  rolesPage(search: \"member\", pageSize: 10, pageNumber: 1)
  {pageInfo {total, totalNumberOfRows}, page {
    id, displayName, usersCount, viewPermissions
  }}
}"
}
);


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": {
    "rolesPage": {
      "pageInfo": {
        "total": 1,
        "totalNumberOfRows": 1
      },
      "page": [
        {
          "id": "abc123",
          "displayName": "Member",
          "usersCount": 14,
          "viewPermissions": [
            "ChangeDashboards",
            "ChangeSavedQueries",
            "ChangeTriggers",
            "ChangeFiles",
            "ChangeParsers",
            "ReadAccess"
          ]
        }
      ]
    }
  }
}

Input Parameters

Filter by search (name text) or typeFilter (permission type — see second table). Use includeHidden to include hidden roles. The required pageSize and pageNumber control pagination.

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.
typeFilter [PermissionType]     The types of permission on which to filter results. See table below.
includeHidden Boolean     Whether to include roles from hidden search domains.
pageNumber Int! yes   Which page to return.
pageSize Int! yes   The number of results returned per page.
search String     Any text on which to search for roles.

This special datatype is an enumerated list of permission types (for example, permission for an asset, or based on a view).

Returned Values

Returns a non-nullable RolePage object. The table below lists all fields:

Table: RolePage 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 
pageRoleyes Long-Term The roles to include in the page. See Role.
pageInfoPageTypeyes Long-Term The page settings. See PageType.

The RolePage type contains Role objects. For reference, the Role datatype table is included here:

Table: Role 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 
descriptionString  Long-Term A description of the role.
displayNameStringyes Long-Term The display name of the role.
groupsGroupyes Long-Term The groups related to the role. See Group.
groupsCountIntyes Long-Term The number of groups related to the role.
idStringyes Long-Term The unique identifier for the role.
limitInt,    The amount of results to return.
organizationManagementPermissionsOrganizationManagementPermissionyes Long-Term The organization management permissions given to the role. See OrganizationManagementPermission.
organizationPermissionsOrganizationPermissionyes Long-Term The organization permissions given to the role. See OrganizationPermission.
readonlyDefaultRoleReadonlyDefaultRole  Short-Term The read-only default role. This parameter is a preview and subject to change. See ReadonlyDefaultRole.
skipInt):GroupResultSetTypeyes Long-Term The number of results to skip or the offset to use. For instance if implementing pagination, set skip = limit * (page - 1)
systemPermissionsSystemPermissionyes Long-Term The system permissions given to the role. See SystemPermission.
usersUseryes Long-Term A list of users assigned the role. See User.
usersCountIntyes Long-Term The number of users assigned the role.
viewPermissionsPermissionyes Long-Term The view permissions given to the role. See Permission.