GET /owners/:ownerId/query
Returns a paginated, sortable, filterable view of an owner’s governance tree — each node with its hierarchy position, budget configuration, and current usage. Use this endpoint to power dashboards, admin UIs, and leaderboards.
Usage figures are served from a periodically-refreshed read model and may lag the live counter by a few minutes. This endpoint never gates — use Check for real-time gate decisions.
Setup
QueryApi is exported from @stigg/governance-client but is not included in the createGovernanceClient factory. Instantiate it separately using the same axios instance that carries your auth headers.
Basic query
Response shape
| Field | Description |
|---|---|
entityId | External ID of the entity (hierarchy node). |
parentId | External ID of the parent entity; null for a root node. Use this to rebuild the tree client-side. |
entityType | External ID of the entity type (e.g., org, team, user). |
capabilityId | External ID of the capability this budget is for. |
scopeEntityIds | The cardinality scope. [] is the node-wide budget; a non-empty set is a dimension-scoped sub-budget. |
usageLimit | Hard usage limit per cadence period. |
currentUsage | Usage consumed in the current cadence period (may lag by minutes). |
utilization | currentUsage / usageLimit. 1.0 when at or over limit; null if no limit. |
cadence | ISO-8601 reset cadence (e.g., P1M). |
usagePeriodStart | Start of the cadence period the snapshot belongs to. |
usagePeriodEnd | When usage resets (exclusive). |
Filtering
Filter by capability
Filter by entity type
Filter by scope
scope value | Rows included |
|---|---|
'all' (default) | All rows |
'nodeWide' | Only node-wide budgets (scopeEntityIds: []) |
'scoped' | Only dimension-scoped sub-budgets |
Filter by utilization
Search by entity ID
Case-insensitive substring match on the entity ID.Sorting
sortBy value | Description |
|---|---|
'utilization' (default) | currentUsage / usageLimit — cross-capability safe |
'currentUsage' | Raw usage count |
'usageLimit' | Configured limit |
'scopeSize' | Node-wide rows first, then scoped by set size |
'id' | Entity ID alphabetical |
'createdAt' | Creation timestamp |
Pagination
The query endpoint uses forward-only cursor pagination.pagination.next is null when you have reached the last page.
queryControllerList parameter reference
Rebuilding the tree client-side
Each row carriesparentId, so you can reconstruct the full hierarchy from a flat response:
