Create a hierarchy node
/api/v1/nodesAuthentication
- Bearer Token
AuthorizationJWT access token
- API Key
X-API-KeyAPI key for management-tier access
Request body
parent_node_idstringParent node ID (null for root)
node_type *stringNode type (org-defined, e.g. 'department', 'team')
name *stringDisplay name for the node
slugstringURL-friendly slug (auto-generated if omitted)
metadataany objectArbitrary metadata
Code samples
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": {}
}'const response = await fetch("https://api.canopy.dev/api/v1/nodes", {
method: "POST",
headers: {
"X-API-Key": "$CANOPY_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parent_node_id": "string",
"node_type": "string",
"name": "string",
"slug": "string",
"metadata": {}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/api/v1/nodes",
headers={
"X-API-Key": "$CANOPY_API_KEY",
"Content-Type": "application/json"
},
json={
"parent_node_id": "string",
"node_type": "string",
"name": "string",
"slug": "string",
"metadata": {},
},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{
"parent_node_id": "string",
"node_type": "string",
"name": "string",
"slug": "string",
"metadata": map[string]interface{}{},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/api/v1/nodes", bytes.NewBuffer(body))
req.Header.Set("X-API-Key", "$CANOPY_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}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
id *stringapplication_id *stringparent_node_idstringnode_type *stringname *stringslug *stringstatus *stringmetadata *any objectcreated_at *string (date-time)updated_at *string (date-time)version *numberOptimistic-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)