Bytefusedocs

Compliance

Repair PDF

Rebuild a damaged or corrupt PDF — recover objects, fix the cross-reference table, and linearize the output for fast web loading.

Free to try — no key required 20 credits / callSynchronous

Overview

Upload a broken PDF; receive a public R2 URL for the repaired, web-optimized copy. On the free-try path.

POSThttps://api.bytefuse.in/api/v1/pdf/repair

Request

Content type multipart/form-data:

filefilerequired
The (possibly corrupt) PDF. Must end in .pdf (else 415). If the file is too damaged for qpdf to recover, the call returns 422.

Response

200 OK, application/json:

200 OK
{
  "success": true,
  "url": "https://<r2-host>/repair/20260704/<uuid>.pdf",
  "credits_charged": 20,
  "pages": 12,
  "original_size": 180422,
  "repaired_size": 164210
}

url is a public R2 link (no expires_at). X-Credits-Charged mirrors credits_charged (0 anonymous).

Examples

curl -X POST https://api.bytefuse.in/api/v1/pdf/repair \
  -F "file=@broken.pdf"
# Add -H "X-API-Key: dt_live_your_key" to run authenticated (20 credits).

Errors

415Missing filename or not a .pdf.
422The PDF is unreadable even after recovery.
402 / 429 / 503Insufficient credits (authenticated), rate limited, or capacity/config error.
500The repair engine failed unexpectedly.

To make a PDF archival, see Convert to PDF/A.