Get Organizations
The allOrganizations query returns organizations available in the admin scope.
You can optionally filter the result by using the where input.
Use this endpoint when you need to:
- List organization codes
- Check whether an organization is active
- Identify the owner organization linked to each record
Query Overviewβ
Path: admin/get-organizations/
GraphQL root:
admin {
allOrganizations(where: {code_in: "code_org"}) {
edges {
node {
organizationsData {
...
}
}
}
}
}
The where filter is optional. This example uses code_in: "code_org" only to illustrate the syntax.
The sample below requests these fields from organizationsData:
codeisActiveowner.code
Common Use Casesβ
- List Organizations: Retrieve the organizations available in the admin scope.
- Check Organization Status: Verify whether a specific organization is active.
- Inspect Ownership: Identify the owner organization associated with each record.
Query Exampleβ
Simple Requestβ
This example retrieves organizations filtered by organization code.
query {
admin {
allOrganizations(where: {code_in: "code_org"}) {
edges {
node {
organizationsData {
code
isActive
owner {
code
}
}
}
}
}
}
}
Variables Exampleβ
This query does not require variables.
{}
Response Exampleβ
Here is an example of the response:
{
"data": {
"admin": {
"allOrganizations": {
"edges": [
{
"node": {
"organizationsData": {
"code": "code_org",
"isActive": true,
"owner": {
"code": "owner_org"
}
}
}
}
]
}
}
}
}
Response Considerationsβ
whereis optional. If you use it,code_in: "code_org"is only a sample filter value.codeis the organization identifier.isActiveindicates whether the organization is active.owner.codehelps identify the owning organization associated with the record.