---
title: "Publish a COMPLETED tree (require_review flow)"
method: POST
path: "/context-documents/tree/{tree_id}/publish"
tags: ["Context Documents"]
---

# Publish a COMPLETED tree (require_review flow)

`POST /context-documents/tree/{tree_id}/publish`

Promote a COMPLETED tree to PUBLISHED.

Only meaningful when the app has `require_review=True`. Apps without
require_review serve COMPLETED to the daemon directly and never need
to publish. Calling this on an app with require_review=False is still
allowed — the row gets stamped published_at/published_by — but it
has no functional effect on what the daemon serves.

Status guard: only COMPLETED can be published. PROCESSING means the
workflow is still writing; FAILED has nothing to ship; PUBLISHED is
a no-op (idempotent).

## Path parameters

- `tree_id` string, required

## Response `200`

Successful Response

- TreeResponse
  - `tree_id` string, required
  - `status` string, required
  - `version` integer, required
  - `files` TreeFile[], nullable, required
    - `path` string, required
    - `content` string, required
    - `tier` string, required
    - `team` string, nullable, required
    - `updated_at` string, required
  - `error` string, nullable, required
  - `created_at` string, date-time, required
  - `completed_at` string, date-time, nullable, required
  - `meta` object, required

## Other responses

- `422` — Validation Error

---

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