Skip to content

Nodes

Org chart nodes — the departments, teams, and roles that make up your organization's tree.

GET/api/v1/nodes

Returns a paginated flat list of all org chart nodes in your organization.

Query parameters

NameTypeRequiredDescription
limitintegeroptionalNumber of results (default 100, max 500).
cursorISO 8601optionalPagination cursor from the previous page's nextCursor.
parentIduuidoptionalFilter to direct children of this node.

Example response

Json
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "parentId": null,
      "title": "Engineering",
      "description": "All software teams",
      "nodeType": "department",
      "sortOrder": 0,
      "color": "#6366f1",
      "metadata": {},
      "createdAt": "2025-03-01T12:00:00.000Z",
      "updatedAt": "2025-03-15T09:30:00.000Z"
    },
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "parentId": "550e8400-e29b-41d4-a716-446655440000",
      "title": "Platform Team",
      "description": "Infrastructure and DevOps",
      "nodeType": "team",
      "sortOrder": 1,
      "color": null,
      "metadata": {},
      "createdAt": "2025-03-02T08:00:00.000Z",
      "updatedAt": "2025-03-02T08:00:00.000Z"
    }
  ],
  "nextCursor": null
}
GET/api/v1/nodes/:id

Returns a single node by ID. 404 if not found or outside your org.

Path parameters

NameTypeRequiredDescription
iduuidrequiredNode ID.

Example response

Json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "parentId": null,
    "title": "Engineering",
    "description": "All software teams",
    "nodeType": "department",
    "sortOrder": 0,
    "color": "#6366f1",
    "metadata": {},
    "createdAt": "2025-03-01T12:00:00.000Z",
    "updatedAt": "2025-03-15T09:30:00.000Z"
  }
}

Node object

Fields

NameTypeRequiredDescription
iduuidoptionalUnique node ID.
parentIduuid | nulloptionalParent node ID. null for root nodes.
titlestringoptionalDisplay name of the node.
descriptionstring | nulloptionalOptional description.
nodeTypestringoptionalType label: department, team, role, or custom.
sortOrderintegeroptionalOrder among siblings (ascending).
colorstring | nulloptionalHex color code, e.g. "#6366f1".
metadataobjectoptionalFree-form JSON metadata attached to this node.
createdAtISO 8601optionalCreation timestamp.
updatedAtISO 8601optionalLast-modified timestamp.

Building a tree from the flat list

The API returns a flat array. Use parentId to reconstruct the hierarchy:

Javascript
function buildTree(nodes) {
  const map = {};
  for (const n of nodes) map[n.id] = { ...n, children: [] };
  const roots = [];
  for (const n of Object.values(map)) {
    if (n.parentId && map[n.parentId]) {
      map[n.parentId].children.push(n);
    } else {
      roots.push(n);
    }
  }
  return roots;
}

Code samples

# List all nodes
curl "https://sopflow.io/api/v1/nodes?limit=100" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

# List children of a specific node
curl "https://sopflow.io/api/v1/nodes?parentId=PARENT_NODE_ID" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Mutating nodes

Mutations require the write scope on the API key. Pass an Idempotency-Key header on POSTs to make the call replay-safe (see Errors & Limits).

POST/api/v1/nodes

Create a node. Set parentId=null for a root node, or another node's id to attach as a child.

Body fields

NameTypeRequiredDescription
parentIduuid | nullrequiredParent node, or null for root.
titlestringrequired1–200 chars.
nodeTypestringrequireddepartment, team, role, or a custom tag.
descriptionstring | nulloptionalUp to 2000 chars.
colorstring | nulloptionalHex code like #6366f1.
sortOrderintegeroptionalPosition among siblings; defaults to last.
metadataobjectoptionalArbitrary JSON.

Example response

Json
{
  "data": {
    "id": "af803555-3a41-4fd2-a8da-79537b8781b0",
    "parentId": null,
    "title": "New Department",
    "nodeType": "department",
    "color": "#6366f1",
    "createdAt": "2026-05-03T04:00:00.000Z"
  }
}
PATCH/api/v1/nodes/:id

Update fields on an existing node. Only the fields you supply are changed.

Body fields (all optional)

NameTypeRequiredDescription
titlestringoptional1–200 chars.
descriptionstring | nulloptional—
nodeTypestringoptional—
colorstring | nulloptionalHex code or null to clear.
metadataobjectoptional—

Example response

Json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "parentId": null,
    "title": "Engineering",
    "description": "All software teams",
    "nodeType": "department",
    "sortOrder": 0,
    "color": "#6366f1",
    "metadata": {},
    "createdAt": "2025-03-01T12:00:00.000Z",
    "updatedAt": "2025-03-15T09:30:00.000Z"
  }
}
POST/api/v1/nodes/:id/move

Re-parent and/or re-order a node. Children move with it.

Body fields

NameTypeRequiredDescription
newParentIduuid | nullrequiredTarget parent, or null to make a new root.
newSortOrderintegerrequiredPosition among new siblings (0-indexed).

Example response

Json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "parentId": null,
    "title": "Engineering",
    "description": "All software teams",
    "nodeType": "department",
    "sortOrder": 0,
    "color": "#6366f1",
    "metadata": {},
    "createdAt": "2025-03-01T12:00:00.000Z",
    "updatedAt": "2025-03-15T09:30:00.000Z"
  }
}
DELETE/api/v1/nodes/:id

Permanently delete a node and every descendant. Returns 204 on success. SOPs assigned to deleted nodes are unassigned but not removed.

Example response

Json
HTTP/1.1 204 No Content

Build a team ownership lookup

Read the organization nodes and keep stable IDs as integration keys. Display the current labels to people, but do not join two records merely because their titles match.

When a node moves, refresh the relevant hierarchy and review assignments. A displayed ownership relationship must not be interpreted as permission to edit or approve content.