Summary

The searchOrganizations() GraphQL query is used to get paginated search results of information about organizations. This is a root operation.

API Stability Short-Term

Syntax

graphql
searchOrganizations(
     searchFilter: string,
     typeFilter: [Organizations__SearchEntryType],
     subscriptionFilter: [Organizations__Subscription],
     includeDeletedFilter: boolean,
     sortBy: Organizations__SortBy!,
     orderBy: OrderBy,
     limit: integer,
     skip: integer
   ): OrganizationSearchResultSet!

For the input, you would give any text on which to search for organizations, indicate whether to include deleted ones, possibly the type of search entity, the type of subscription, how to sort results), how to order results, and the number of results to skip and how many to return. See the Input Parameters section for details.

For the results, you can get the total results found and information on the organizations found. See the Returned Values section further down this page.

Example

Raw
graphql
query {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}
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 {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}"
}
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 {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}"
}
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 { ^
  searchOrganizations( ^
    typeFilter: Organization ^
    subscriptionFilter: Paying ^
    sortBy: Name ^
    orderBy: ASC ^
  ) ^
   {totalResults,  ^
    results {organizationId, organizationName, userCount}} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}"
}'
    "$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 {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}";
$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 {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}"
}'''

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 {
  searchOrganizations(
    typeFilter: Organization
    subscriptionFilter: Paying
    sortBy: Name
    orderBy: ASC
  )
   {totalResults, 
    results {organizationId, organizationName, userCount}}
}"
}
);


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": {
    "searchOrganizations": {
      "totalResults": 1,
      "results": [
        {
          "organizationId": "SINGLE_ORGANIZATION_ID",
          "organizationName": "SingleOrganization",
          "userCount": 18
        }
      ]
    }
  }
}

Input Parameters

For the input, you would provide any text on which to search for organizations, indicate whether to include deleted ones, possibly the type of search entity (see second table below), the type of subscription (see the third table), how to sort results (see fourth), how to order results (see fifth), and the number of results to skip and how many to return.

Table: Input Using Standard Datatypes

Parameter Type Required Default Description
includeDeletedFilter boolean     Whether to include deleted organizations in results.
limit integer   50 The maximum number of results to return.
searchFilter string    ; Any text on which to filter results.
skip integer   0 The number of results to skip, or offset to use.

Table: Organizations__SearchEntryType

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 10, 2025
Organization   Short-TermSearch entry type is an organization.
Repository   Short-TermSearch entry type is a repository.
User   Short-TermSearch entry type is a user.
View   Short-TermSearch entry type is a view.

The second datatype allows you to filter based on the type of LogScale subscription (e.g., Trial, Paying). There are many choices and they're listed in the table below:

Table: Organizations__Subscription

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: Aug 21, 2025
ClusterOwner   Short-TermThe organization's subscription is that of a cluster owner.
CommunityLocked   Short-TermThe organization has a locked community subscription.
CommunityUnlocked   Short-TermThe organization has an unlocked community subscription.
Complementary   Short-TermThe organization has a complementary subscription.
MissingTOSAcceptance   Short-TermThe organization has not yet accepted the terms of service.
OnPremMonitor   Short-TermThe organization has an on premise subscription.
Partner   Short-TermThe organization has a partner subscription.
Paying   Short-TermThe organization has a paying subscription.
PostTrial   Short-TermThe organization has a post-trial subscription.
PreTrial   Short-TermThe organization has a pre-trial subscription.
Trial   Short-TermThe organization has a trial subscription.
UnlimitedPoC   Short-TermThe organization has a unlimited proof of contract subscription.
Internal   Short-TermThe organization has an internal use only subscription.
Churned   Short-TermThe organization has a churned subscription.
Unknown   Short-TermThe organization's subscription is unknown.

The next datatype allows you to sort the results based other factors, such as the number of users in each organization, when each organization was created. The choices for this are listed in the table below:

Table: Organizations__SortBy

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: Aug 21, 2025
CreatedAt   Short-TermSort organizations by date created.
Name   Short-TermSort organizations by name.
Subscription   Short-TermSort organizations by type of subscription.
UserCount   Short-TermSort organizations by number of users.
ViewCount   Short-TermSort organizations by number of views.
Volume   Short-TermSort organizations by volume used.

The other input datatype is a simple one. You can return results based on whether they are in ascending or descending order, alphanumerically.

Table: OrderBy

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 10, 2025
ASC  ✓Long-TermOrder results in ascending order (e.g., 0 to 9, A to Z).
DESC   Long-TermOrder results in descending order (e.g., 9 to 0, Z to A).

Returned

The returned datatype is used to get the total results found, and through a sub-parameter, you can get the information on the organizations found. To see these choices, you'll have to click on the link below to the table for the datatype it uses.

Table: OrganizationSearchResultSet

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 27, 2024
results[OrganizationSearchResultEntry]yes Short-TermThe paginated result set. See OrganizationSearchResultEntry.
totalResultsintegeryes Short-TermThe total number of matching results.