---
title: "Update a document node"
method: PATCH
path: "/v1/documents/{id}/nodes/{node_id}"
tags: ["documents"]
---

# Update a document node

`PATCH /v1/documents/{id}/nodes/{node_id}`

Partially updates a single node by its document and node IDs. Only provided fields are changed. `metadata.attributes` is merged key-by-key. `cross_ref_node_ids` is replaced when provided.

## Path parameters

- `id` string, required
- `node_id` string, required

## Request body

- UpdateNodeRequest — Request body for updating a document node. All fields are optional; only provided fields are changed.
  - `title` string — Updated node title
  - `summary` string — Updated LLM summary used during tree traversal
  - `content` string — Updated leaf content (only meaningful for leaf nodes)
  - `image_path` string — Updated path to associated image for vision-enabled reasoning
  - `metadata` UpdateNodeMetadataRequest — Partial update for node metadata fields. All fields are optional.
    - `page_number` integer — Page number in the source document
    - `section_type` string — Section type (e.g. 'chapter', 'section', 'paragraph')
    - `confidence_score` number, float — Confidence score assigned during ingestion
    - `attributes` object — Custom key-value attributes to merge into the node (string values only)
    - `cross_ref_node_ids` string[] — IDs of sibling nodes this node explicitly cross-references (replaces existing list)

## Response `200`

Node updated successfully

- NodeDetail — Full details for a single document node.
  - `id` string — Unique node ID
  - `document_id` string — Parent document ID
  - `title` string — Node title
  - `summary` string — LLM-generated summary used for tree traversal
  - `depth` integer — Depth in the tree (0 = root)
  - `is_leaf` boolean — Whether this is a leaf node (no children)
  - `content` string — Actual content (only present for leaf nodes)
  - `image_path` string — Path to associated image for vision-enabled reasoning
  - `parent_id` string — Parent node ID (null for root nodes)
  - `children_ids` string[] — IDs of child nodes
  - `page_number` integer — Page number in the source document
  - `section_type` string — Section type (e.g. 'chapter', 'section', 'paragraph')
  - `confidence_score` number, float — Confidence score assigned during ingestion
  - `attributes` object — Custom key-value attributes (string values)
  - `cross_ref_node_ids` string[] — IDs of sibling nodes this node cross-references
  - `created_at` string, date-time — Node creation timestamp
  - `updated_at` string, date-time — Last update timestamp

## Other responses

- `404` — Document or node not found
- `500` — Storage error

---

[API](https://skmtc.net/brainfish-ai/apis/reasondb-api.md) · [All operations](https://skmtc.net/brainfish-ai/apis/reasondb-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/brainfish-ai/reasondb-api/versions/f8665c1a5239/schema)
