Skip to content

documents->delete

documents->delete(string $id): void

Soft-delete a stored document. The PDF is purged from storage; metadata is retained for audit. A re-delete surfaces as a from the transport layer.

Name Type Required Description
$id string required (no description)

void

Code When
DOCUMENT_NOT_FOUND See [errors](../../../production/errors/) for the full description.
INVALID_API_KEY See [errors](../../../production/errors/) for the full description.
INTERNAL_ERROR See [errors](../../../production/errors/) for the full description.
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use PoliPage\PoliPage;
$client = PoliPage::client($_ENV['POLI_PAGE_API_KEY']);
$documentId = $argv[1] ?? throw new RuntimeException('usage: documents-delete.php <documentId>');
$client->documents->delete($documentId);
echo "deleted {$documentId}\n";