Keep the documents a sync held for removal
Decline the removal a re-sync held. Nothing is removed and the documents stay in use.
POST
/
knowledge
/
sources
/
{source_id}
/
removal
/
keep
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/sources/3f1e7c2a-9b4d-4e61-8a05-6d2c9e7b1f30/removal/keep" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
When a re-sync would remove more than 45% of a source’s documents, the removal is held (see Confirm a held removal). This call is the no. Nothing is removed, and the held run’s
error_code becomes removal_kept.
The source is then treated as read at the held run’s version, so scheduled syncs skip it until the source changes. A manual sync reads it again and holds the removal again if the documents are still missing, so fix the source (the sitemap, the branch, the credential) before syncing it by hand.
Keeping requires a role that can delete documents; others receive 403. 409 means the source’s latest run holds no removal. An unknown ID or another organization’s source returns 404. The decision is recorded in the audit log as knowledge_source.removal_keep.
string
required
Source ID (a UUID).
Response
Returns200 with the held run as it now reads: error_code removal_kept, in the job shape Get a job returns.
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/sources/3f1e7c2a-9b4d-4e61-8a05-6d2c9e7b1f30/removal/keep" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
Last modified on November 12, 2026
curl --request POST "$MITHUNAI_URL/mithunai/api/v1/knowledge/sources/3f1e7c2a-9b4d-4e61-8a05-6d2c9e7b1f30/removal/keep" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"