Skip to content

client.documents.delete

client.documents.delete(id)

DELETE /v1/documents/:id — returns nil. Re-deleting an already-deleted document surfaces as PoliPage::GoneError (HTTP 410) — no special handling here.

Name Type Required Description
id String (no description)

nil

Code When
PoliPage::NotFoundError See [errors](../../../production/errors/) for the full description.
PoliPage::GoneError See [errors](../../../production/errors/) for the full description.
PoliPage::AuthenticationError See [errors](../../../production/errors/) for the full description.
PoliPage::InternalError See [errors](../../../production/errors/) for the full description.
PoliPage::APIError See [errors](../../../production/errors/) for the full description.
# frozen_string_literal: true
# Demonstrates: client.documents.delete — soft-delete a stored document.
require "poli_page"
client = PoliPage::Client.new(api_key: ENV.fetch("POLI_PAGE_API_KEY"))
client.documents.delete("doc_INV-001")
# Returns nil. Re-deleting an already-deleted document raises
# `PoliPage::GoneError` (HTTP 410).
puts "deleted doc_INV-001"