# Integration Examples

This page collects practical integration patterns for production systems.

## Queue-based architecture

Recommended for high-volume ingestion:

1. Application uploads source PDFs to your backend.
2. Backend enqueues a redaction task.
3. Worker creates Redact PDF AI jobs with idempotency keys.
4. Worker polls status and downloads outputs.
5. Worker stores redacted outputs in your system of record.

## Multi-tenant key management

- Keep one API key per environment at minimum.
- For enterprise isolation, map internal tenants to independent service credentials and processing queues.

## Incident-safe processing

- Persist `job_id`, `document_id`, and `request_id` on every state change.
- Use idempotency keys on all job creations.
- Add dead-letter handling for repeated `5xx` failures.

## Compliance-aligned processing

- Default to `retention=ephemeral`.
- Use `retention=studio` only when human review is required.
- Delete jobs after export with `DELETE /v1/jobs/{job_id}`.

## Minimal production checklist

- [ ] server-side key storage
- [ ] idempotency on create job
- [ ] retry policy for `429`/`5xx`
- [ ] alerting on error rates and quota events
- [ ] data retention and deletion runbooks
