Skip to content

client.documents.delete

client.documents.delete(id)

DELETE /v1/documents/:id — returns nil on 204. Idempotent: the API answers 204 again for an already-deleted document.

Name Type Required Description
id String — (no description)

nil

Code When
PoliPage::NotFoundError See [errors](../../../production/errors/) for the full description.
PoliPage::PermissionDeniedError 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. Idempotent: re-deleting an already-deleted document also
# returns nil (the API answers 204 again).
puts "deleted doc_INV-001"