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.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id | String | — | (no description) |
Returns
Section titled “Returns”nil
Errors
Section titled “Errors”| 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. |
Example
Section titled “Example”# 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"