Get subtree from a node
/api/v1/nodes/{id}/treeAuthentication
- Bearer Token
AuthorizationJWT access token
- API Key
X-API-KeyAPI key for management-tier access
Path Parameters
| Name | Required | Type | Description |
|---|---|---|---|
id | string |
Code samples
curl -X GET "https://api.canopy.dev/api/v1/nodes/value/tree" \ -H "X-API-Key: $CANOPY_API_KEY"
const response = await fetch("https://api.canopy.dev/api/v1/nodes/value/tree", {
method: "GET",
headers: {
"X-API-Key": "$CANOPY_API_KEY"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.canopy.dev/api/v1/nodes/value/tree",
headers={
"X-API-Key": "$CANOPY_API_KEY"
},
)
data = response.json()package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.canopy.dev/api/v1/nodes/value/tree", nil)
req.Header.Set("X-API-Key", "$CANOPY_API_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
200 Subtree returned
{
"id": "string",
"name": "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",
"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",
"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",
"slug": "string",
"node_type": "string",
"parent_node_id": "string",
"status": "string",
"access_state": "accessible",
"can_access": false,
"can_manage": false,
"children": [
{
"id": null,
"name": null,
"slug": null,
"node_type": null,
"parent_node_id": null,
"status": null,
"access_state": null,
"can_access": null,
"can_manage": null,
"children": null,
"version": null
}
],
"version": 0
}
],
"version": 0
}
],
"version": 0
}
],
"version": 0
}application/json
id *stringname *stringslug *stringnode_type *stringOrg-defined node type
parent_node_id *stringstatus *stringaccess_state *enum: "accessible" | "context_only"can_access *booleancan_manage *booleanchildren *HierarchyTreeNodeDto[]version *numberOptimistic-lock version. Send back as the `If-Match` header when mutating this node to detect concurrent edits.
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)