1. Docs
  2. API Reference
  3. Update a hierarchy node

Update a hierarchy node

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

Authentication

  • Bearer Token Authorization

    JWT access token

Path Parameters

Name Required Type Description
idRequiredstring

Headers

  • if-match required
  • If-Match

    Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.

Request body

  • namestring

    Updated display name

  • slugstring

    Updated slug

  • statusstring

    Updated status (active/inactive)

  • metadataany object

    Updated metadata

  • parent_node_idstring

    New parent node ID (reparent)

Code samples

cURLJavaScriptPythonGo
curl -X PATCH "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/nodes/value" \
  -H "if-match: value" \
  -H "If-Match: value" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "slug": "string",
    "status": "string",
    "metadata": {},
    "parent_node_id": "string"
  }'

Responses

200 Node updated successfully
{
  "id": "string",
  "application_id": "string",
  "parent_node_id": "string",
  "node_type": "string",
  "name": "string",
  "slug": "string",
  "status": "string",
  "metadata": {},
  "created_at": "2026-04-20T12:00:00.000Z",
  "updated_at": "2026-04-20T12:00:00.000Z",
  "version": 0
}

application/json

  • idstring*
  • application_idstring*
  • parent_node_idstring
  • node_typestring*
  • namestring*
  • slugstring*
  • statusstring*
  • metadataany object*
  • created_atstring (date-time)*
  • updated_atstring (date-time)*
  • versionnumber*

    Optimistic-lock version. Send back as the `If-Match` header when updating, moving, or deleting to detect concurrent edits.

400 Invalid parent-child relationship
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)
404 Node not found
409 Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.

Returned object

On this page

Related endpoints

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