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

Create a hierarchy node

POST/api/v1/nodes

Authentication

  • Bearer Token Authorization

    JWT access token

  • API Key X-API-Key

    API key for management-tier access

Request body

  • parent_node_idstring

    Parent node ID (null for root)

  • node_typestring*

    Node type (org-defined, e.g. 'department', 'team')

  • namestring*

    Display name for the node

  • slugstring

    URL-friendly slug (auto-generated if omitted)

  • metadataany object

    Arbitrary metadata

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/api/v1/nodes" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parent_node_id": "string",
    "node_type": "string",
    "name": "string",
    "slug": "string",
    "metadata": {}
  }'

Responses

201 Node created 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.

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