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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
statusqueryone of "PENDING", "ACCEPTED", "REJECTED", "STALE"noReturn only patches in this state. Omit for all of them.
StatusDescriptionBody
200application/json PendingPatchResponseDtoDataArrayEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
patchIdpathstringyes
StatusDescriptionBody
200application/json PendingPatchDecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
patchIdpathstringyes

Request body: application/json RejectPatchDto

StatusDescriptionBody
200application/json PendingPatchDecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
StatusDescriptionBody
200application/json ReviewStateResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
StatusDescriptionBody
200application/json ReviewStateResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/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>)

ParameterInTypeRequiredDescription
pageIdpathstringyes
StatusDescriptionBody
200application/json PageSessionResyncResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto