Summary

The parentOrganizations() GraphQL query returns a list of linked parent organizations.

Stability Level Short-Term

Syntax

graphql
parentOrganizations(
      search: String,
      skip: Int! = 0,
      limit: Int! = 50,
      orderBy: OrderBy = ASC,
      sortBy: OrganizationsLinks__SortBy = Name
   ): ParentOrganizationsResultSet!

Provide an optional search string to filter by organization name. Use limit and skip for pagination. Use sortBy and orderBy to control result order. See the Input Parameters section for details.

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

Example

Raw
graphql
query {
  parentOrganizations(
    search: "abc123", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}
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 {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}"
}
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 {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}"
}
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 { ^
  parentOrganizations( ^
    search: \"abc123\",  ^
    skip: 0, ^
    limit: 50, ^
    orderBy: ASC, ^
    sortBy: Name )     ^
   { totalResults, ^
      results { id } } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}"
}'
    "$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 {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}";
$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 {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}"
}'''

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 {
  parentOrganizations(
    search: \"abc123\", 
    skip: 0,
    limit: 50,
    orderBy: ASC,
    sortBy: Name )    
   { totalResults,
      results { id } }
}"
}
);


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": {
    "parentOrganizations": {
      "totalResults": "1",
      "results":  {
         "id": "def456"
      }
    }
  }
}

Input Parameters

Provide an optional search string to filter results. Use sortBy to set the sort field (see table below) and orderBy to set the order direction. Use limit and skip for pagination.

Table: Input Parameters & Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this query. Since some of the parameters use special datatypes, additional tables for them are included below.
limit Int! yes 50 The number of organizations to limit results.
orderBy OrderBy   ASC How to order results. See table below.
search String     Any text by which to search.
skip Int! yes 0 The number of results to skip.
sortBy OrganizationsLinks__SortBy   Name The basis for sorting organizations in the results. See table below.

You can sort the results found by some identifying element (for example, organization name). This allows you to group results. The choices for sorting are listed here along with descriptions of each:

In addition to sorting, you can then return results by either ascending or descending order.

Returned Values

Returns a non-nullable ParentOrganizationsResultSet object with two fields: totalResults (the total number of matching organizations) and results (a non-nullable list of Organization objects). The table below lists all fields:

Table: ParentOrganizationsResultSet 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 
resultsOrganizationyes Short-Term The paginated result set. See Organization.
totalResultsIntyes Short-Term The total number of matching results.