Set a source's diff policy
Choose when a synchronized source’s changes wait for review.
v2 compatibility notes
POST /api/v2/knowledge/synchronized-sources/setDiffPolicy requires knowledge:manage. The body is {sourceId, expectedRevision, policy}: policy is null (changes apply without review), {"mode": "always"}, or {"mode": "conditional"} with at least one of deleteCountExceeds, protectedKinds (kinds the source declares) and protectCases: true. expectedRevision is the state’s policyRevision. The answer is {sourceId, outcome, revision}: updated (the source’s open diff runs stop, and later runs follow the new policy), unchanged, or stale (the policy moved; revision is its current one). A malformed policy answers 400 bad_request; a source outside the writable namespaces, 404 resource_missing.
Only a Personal key is admitted, acting as its owner: the owner must hold the permission where the source lives, and is recorded as the decider, with the key named in the audit. An External App or platform key answers 403 forbidden, recorded: a person reviews and decides a source’s held changes.
Send an Idempotency-Key to retry safely. A completed 200 response remains stored for 24 hours and is replayed only while the caller still holds knowledge:read and the source is still in its writable namespaces. Lost access, a missing source or a stored non-200 response yields 409 idempotency_result_unavailable; the request never runs twice.Authorizations
Headers
1–255 printable ASCII characters. A repeat with the same key and request never runs the write again, a 5xx included. It returns the first response (Idempotency-Replayed: true) only when the route's current authorization policy permits disclosure; otherwise 409 idempotency_result_unavailable. Honoured for External App JWTs and platform and MCP keys; an External App's static companion key is not protected.
1 - 255Body
policy: null (changes apply without review), {mode: "always"} (every run's changes wait for review), or {mode: "conditional", …} with at least one of deleteCountExceeds, protectedKinds (kinds the source declares) and protectCases: true. expectedRevision is the state's policyRevision.
Response
Set a source's diff policy

