Skip to content

documents.delete

documents.delete(id: str) -> None

Soft-delete a stored document.

Name Type Required Description
id str required The `document_id` of the stored document to delete.

None — None. The PDF is purged; metadata is retained for audit.

Code When
DOCUMENT_NOT_FOUND No stored document matches the supplied id. An already-deleted document is not an error (`204`).
FORBIDDEN The document belongs to another organization or another environment than the key's.
ENVIRONMENT_PROTECTED The environment is protected and the key's role is not owner or admin.
INVALID_API_KEY The API key is malformed or revoked.
INTERNAL_ERROR The API returned 5xx. Retryable.
# Demonstrates: client.documents.delete(id) — soft-delete a stored document.
from poli_page import PoliPage
client = PoliPage()
client.documents.delete("doc_abc123")
# Returns None, also for an already-deleted document (deletes are idempotent).
# The PDF is purged; metadata is retained for audit.
print("Deleted.")