Skip to content

Deletion and retention

Data Kept for
Source file, outputs and events Seven days after upload. The time is fixed at upload and shown as expires_at in the receipt and status.
Event replay A rolling 24 hours, and never longer than the document
Idempotency bindings At least 24 hours

When a document expires it behaves as if it were deleted: reads return 404 document_not_found, and it is no longer listed.

DELETE /documents/{document_id} requires documents:write. It always returns 204: for a document you just deleted, one already deleted, one that never existed, or one in another tenant. The response never reveals whether a document exists.

Once the 204 is returned:

  • every read of the document returns 404;
  • queued and running work stops, and in-progress results are not published;
  • event tickets and open subscriptions for it are revoked;
  • unsent webhook deliveries are cancelled. A delivery already sent cannot be recalled.

The source, outputs, temporary files and events are purged within 24 hours. Minimal records without document content may remain for billing, audit and idempotency.

docs/public/examples/curl/delete.sh
#!/usr/bin/env bash
# Sonic Docs contract example: delete a document and its outputs.
# Written against the planned v1 contract; not yet run against a live API.
set -euo pipefail
API_BASE="${SONIC_API_BASE:-https://api.sonicdocs.ai/v1}"
: "${SONIC_API_KEY:?Set SONIC_API_KEY to a key with documents:write}"
DOCUMENT_ID="${1:?Usage: delete.sh DOCUMENT_ID}"
# 204 means the document is no longer readable, whether or not it existed.
curl -sS --fail-with-body -X DELETE -H "Authorization: Bearer $SONIC_API_KEY" \
"$API_BASE/documents/$DOCUMENT_ID"
echo "Deleted $DOCUMENT_ID"

Deleted data can remain in backups for up to 30 days. Before any backup is restored, deletions recorded since are applied again, so deleted documents do not come back. There is no zero-retention mode and no promise of immediate erasure from backups.