API / deployment

Redaction webhooks that do not leak in the URL

A practical guide to redaction webhook: the boundary, the controls and the failure modes that matter before the first document.

Redaction Webhook: Deployment and Limits

Redaction webhooks that do not leak in the URL. A webhook is a callback from the service to your endpoint. It should carry a job id and a status, not the document or the extracted text. The URL is often logged by proxies, so it is the wrong place for an identifier.

What changes in this environment

Register an HTTPS endpoint, verify the signature, acknowledge quickly and fetch the output from the authenticated API. Retries are expected; the handler must be idempotent. A queue between the endpoint and the worker protects the response time.

Where the data hides

The visible page is only one layer. In this environment, check:

The redaction flow

  1. Register the endpoint and store the signing secret.
  2. Receive the event and verify the signature.
  3. Acknowledge with a 2xx and enqueue the job id.
  4. Fetch the report and the output from the API.
  5. Record the terminal state and delete the event.

Controls to verify

  • HTTPS with a valid certificate.
  • Signature verification and a timestamp window.
  • Idempotency on the job id.
  • No document data or PII in the URL.
  • A dead-letter queue with an owner.

Retention and evidence

The callback payload and the queue can retain a job id longer than the document. That is usually acceptable, but the URL and the logs still need a retention rule. Do not put a file name or an email address in the path.

Limits

Webhooks are at-least-once in most designs, so duplicates are normal. A slow endpoint causes retries and timeouts. The callback is not a delivery guarantee for the document; the API download is.

The three failure modes

Webhooks fail in three familiar ways, and the design should name its answer to each. Delivery failure: the receiver is down, and the sender retries — your endpoint must be idempotent, because the retry is a duplicate of an event you may have processed. Ordering failure: events arrive out of sequence, and state built on order corrupts — sequence numbers or timestamps in the payload let you reconstruct. Spoofing: anyone can POST a payload shaped like yours — a shared secret or signature verification is the floor, not an option.

What belongs in the payload

The payload should carry identifiers, not documents: the job id, the file reference your system already holds, the status, and the report location. Payloads carrying the file or its content invite the webhook itself to become a data channel — a second copy of the sensitive payload, logged by every proxy in between. Verify the signature before parsing deeply, reject stale timestamps to blunt replays, and answer with a fast acknowledgment; heavy work belongs in your queue, not the HTTP handler.

The receiver's checklist

The receiving side earns its keep in six lines: verify the signature before parsing, reject timestamps older than a few minutes, answer two hundred fast, enqueue the payload, process idempotently by event id, and alert when the queue ages. Each line answers one outage. The endpoint also needs its own authentication story — the webhook URL is a door, and an unauthenticated door turns the sender's retry storm into your incident.

How Veilbrook fits

Veilbrook can notify a job state through a callback and return the output through the API. The signature check, the queue and the idempotency are yours to implement.

Before you release

Open the output in the same tool the recipient will use. Select each masked area and paste it into a text editor. Search for every value you removed, including the header, the attachment, the comment and the OCR layer. Compare the report with the file and keep both. If a value survives, the job is not done.

Common mistakes

What to ask before you build

Questions

Can the document be sent in the webhook?

It should not be. Send a job id and a status; fetch the document through the authenticated API.

How do we handle duplicate callbacks?

Key the handler on the job id and make the state transition idempotent.

What if our endpoint is down?

The service retries. Keep a dead-letter queue and reconcile, rather than assuming the event was lost.