Document Review
Operations of the Knowledge Base API. Paths are relative to your deployment's API host.
GET /api/knowledge-base-api/pages/{pageId}/pending-patches
List the individually-reviewable changes on a document page, in application order.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes | |
status | query | one of "PENDING", "ACCEPTED", "REJECTED", "STALE" | no | Return only patches in this state. Omit for all of them. |
| Status | Description | Body |
|---|---|---|
| 200 | application/json PendingPatchResponseDtoDataArrayEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
POST /api/knowledge-base-api/pages/{pageId}/pending-patches/{patchId}/accept
Accept ONE change. Records the decision; the text is already live, so no content changes. Answers 200 with sessionResync once recorded, whatever the session did. 409 if the patch was already decided or its anchor no longer resolves.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes | |
patchId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json PendingPatchDecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
POST /api/knowledge-base-api/pages/{pageId}/pending-patches/{patchId}/reject
Reject ONE change, restoring the baseline text for exactly that hunk. An optional comment records why, so the agent can revise. Answers 200 with sessionResync once recorded, whatever the session did. 409 if already decided or STALE.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes | |
patchId | path | string | yes |
Request body: application/json RejectPatchDto
| Status | Description | Body |
|---|---|---|
| 200 | application/json PendingPatchDecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
POST /api/knowledge-base-api/pages/{pageId}/review/accept
Accept ("Done") the agent's unreviewed changes on a document page — clears the review baseline. Idempotent.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json ReviewStateResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
POST /api/knowledge-base-api/pages/{pageId}/review/undo
Undo the agent's unreviewed changes on a document page — reverts content to the review baseline, then clears it. Idempotent.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json ReviewStateResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
POST /api/knowledge-base-api/pages/{pageId}/session-resync
Have the page's live authoring session re-materialize its working files from the page's current state. Idempotent; the retry after a decision answered sessionResync: failed. Until the kernel working-file binding names its object (P2), every bidirectional working file of the session re-materializes, not only this page's.
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
pageId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json PageSessionResyncResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |