API Stability Short-Term

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

Related to this query is the organization() query for extracting information on an organization. There are also the createEmptyOrganization() and updateOrganizationInfo() mutation fields for creating and changing an organization.

Plus, there are the mutations rollbackOrganization(), removeOrganization() to delete an organization, and recoverOrganization() to recover a deleted organization.

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 can give a search string for the organization names on which to filter results. You can filter results based on the type search entry (e.g., User, View) and type of subscription (e.g., Paying), as well as whether to include deleted organizations. See the Given Datatypes section for more details.

You can sort the results based factors such as the number of users in each organization and when each was created. You can also indicate whether results should be in ascending or descending order. You can opt to skip the first so many results with the skip parameter — it's default value is 0. Use the limit parameter to limit the number of results returned — its default is 50.

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

Example

Below is an example of how this query field might be used:

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

Given Datatypes

There are a few given datatypes for this query. The first allows you to filter results based on the type search entry (e.g., User, View). The choices for this are listed in the table here:

Table: Organizations__SearchEntryType

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 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 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: 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 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: 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 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 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 Datatype

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