v38

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-1793196344.2 KB
Context Documents

Edit files in a context document tree

Edit files in a tree.

Supports three edit kinds — all persist to the tree_edits table so they survive subsequent regens:

  • files: content edits (map of path → new content)
  • renames: rename edits (map of old path → new path)
  • deletions: soft-delete (list of paths)

Editable when status is COMPLETED or PUBLISHED. PROCESSING is rejected (the workflow is mid-write); FAILED has nothing meaningful to edit. The tree's files JSONB is updated in-place so the dashboard sees immediate results without waiting for the next regen.

patch/context-documents/tree/{tree_id}/files

Path parameters

tree_idstring required

Request body

filesobject

Map of file path → new content (content edits).

renamesobject

Map of old path → new path (rename edits).

deletionsstring[]

List of file paths to soft-delete (sticky until cleared).

additionsobject

Map of file path → initial content for user-declared files at paths the LLM doesn't produce. Sticky until cleared.

Response

Successful Response

tree_idstring required
statusstring required
versioninteger required
errorstring nullable required
created_atstring date-time required
completed_atstring date-time nullable required
metaobject required