1. Docs
  2. API Reference
  3. Get subtree from a node

Get subtree from a node

GET/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/nodes/{id}/tree

Authentication

  • Bearer Token Authorization

    JWT access token

Path Parameters

Name Required Type Description
idRequiredstring

Code samples

cURLJavaScriptPythonGo
curl -X GET "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/nodes/value/tree" \
  -H "Authorization: Bearer $CANOPY_TOKEN"

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

  • idstring*
  • namestring*
  • slugstring*
  • node_typestring*

    Org-defined node type

  • parent_node_idstring*
  • statusstring*
  • access_stateenum: "accessible" | "context_only"*
  • can_accessboolean*
  • can_manageboolean*
  • childrenHierarchyTreeNodeDto[]*
  • versionnumber*

    Optimistic-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)

Returned object

On this page

Related endpoints

GETList hierarchy (scoped tree)
POSTCreate a hierarchy node
GETGet a hierarchy node
PATCHUpdate a hierarchy node
DELETEDelete a hierarchy 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