1. Docs
  2. API Reference
  3. List hierarchy (scoped tree)

List hierarchy (scoped tree)

GET/api/v1/nodes

Returns the caller's accessible hierarchy as a nested tree for the current Environment, each node annotated with access_state, can_access, and can_manage. user principals (dashboard) see the full tree; API-key principals see only the subtree their access_mode/scopes grant — full_access unlocks everything, while scoped keys see nodes reachable via hierarchy.view. The response also includes a scope block listing accessible_node_ids, scope_root_node_ids, and entry_node_ids.

Authentication

Bearer TokenAuthorization Option A

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

API KeyX-API-Key Option B

API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.

Headers

  • If-None-Match

    An `ETag` from a previous response. Answers `304 Not Modified` when the hierarchy has not changed since, so a client holding a cached tree can revalidate on a short interval without re-reading it.

Responses

application/json

  • dataScopedHierarchyTreeResponseDto*

The hierarchy is unchanged since the supplied `ETag`. No body; keep using the cached tree.

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X GET "https://auth.canopy-io.com/api/v1/nodes" \
  -H "If-None-Match: value" \
  -H "X-API-Key: $CANOPY_API_KEY"
Response
{
  "data": {
    "tree": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "slug": "string",
        "node_type": "string",
        "parent_node_id": "string",
        "status": "string",
        "access_state": "accessible",
        "can_access": false,
        "can_manage": false,
        "children": [
          {
            "id": "string",
            "name": "string",
            "description": "string",
            "slug": "string",
            "node_type": "string",
            "parent_node_id": "string",
            "status": "string",
            "access_state": "accessible",
            "can_access": false,
            "can_manage": false,
            "children": [
              {
                "id": "string",
                "name": "string",
                "description": "string",
                "slug": "string",
                "node_type": "string",
                "parent_node_id": "string",
                "status": "string",
                "access_state": "accessible",
                "can_access": false,
                "can_manage": false,
                "children": [
                  null
                ],
                "version": 0,
                "direct_count": 0,
                "inherited_count": 0
              }
            ],
            "version": 0,
            "direct_count": 0,
            "inherited_count": 0
          }
        ],
        "version": 0,
        "direct_count": 0,
        "inherited_count": 0
      }
    ],
    "scope": {
      "accessible_node_ids": [
        "string"
      ],
      "scope_root_node_ids": [
        "string"
      ],
      "entry_node_ids": [
        "string"
      ]
    }
  }
}
Related endpoints
POSTCreate a hierarchy node
GETList the hierarchy as parent edges
GETGet a hierarchy node
PATCHUpdate a hierarchy node
DELETEDelete a hierarchy node
GETGet subtree from a node
GETGet ancestor chain for a node
GETGet direct children of a node
POSTMove (reparent) a node
GETList identities at a node
GETGet identity summary for a node
Was this page helpful?

Tell us how we can improve this guide.