API Stability Short-Term

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

Syntax

Below is the syntax for the searchOrganizations() query field:

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, there are several parameters. Some have default values: skip is 0; and limit is 50. There are defaults for the special datatypes. They're described in the Given Datatypes section below.

The parameters for the return datatype OrganizationSearchResultSet is listed in the Returned Datatypes section.

Below is an example of how this query field may 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/graphql',
  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

The special input datatypes Organizations__SearchEntryType, Organizations__Subscription, Organizations__SortBy and OrderBy each have some parameters. They're listed in the four tables here:

Table: Organizations__SearchEntryType

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
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.

Table: Organizations__Subscription

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
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.

Table: Organizations__SortBy

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
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.

Table: OrderBy

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
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 Datatypes

The returned datatype OrganizationSearchResultSet has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: OrganizationSearchResultSet

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 27, 2024
results[OrganizationSearchResultEntry]yes Short-TermThe paginated result set. See OrganizationSearchResultEntry.
totalResultsintegeryes Short-TermThe total number of matching results.