Documents API
Erase uploaded documents and derived data for privacy workflows
Use your workspace API base URL
Set
KLAREFI_API_BASE_URLto the value in Settings → Developer before using the example. Current workspaces may use ahttps://<deployment>.convex.siteURL.
DELETE /api/v1/documents/{docId}
Required scope: privacy:erase
curl -X DELETE "$KLAREFI_API_BASE_URL/api/v1/documents/doc_def456" \
-H "Authorization: Bearer $KLAREFI_API_KEY"The erasure job deletes the document and derived evidence, candidates, case document links, artifacts, uploads, and storage objects where present.
200 means the erasure completed in the current batch. 202 means Klarefi
deleted a batch and more work remains.
{
"erasure_receipt": {
"doc_id": "doc_def456",
"audit_id": "audit_001",
"completed": true,
"batch_count": 8,
"batch_limit": 100,
"remaining_budget": 92,
"deleted_evidence": 5,
"deleted_candidates": 3,
"deleted_case_documents": 1,
"deleted_artifacts": 2,
"deleted_uploads": 1,
"deleted_storage_objects": 1,
"deleted_document": true,
"timestamp": "2026-01-15T10:30:00.000Z"
}
}If the document does not exist for the organization, Klarefi returns
404 not_found.