Strip the invisible: JavaScript actions, open-actions, form fields and embedded files are removed and the file is rewritten, so orphaned objects are gone too. The counterpart to redact before handing a document out.
curl -X POST https://api.bigapi.dev/v1/pdf/sanitize -H 'Authorization: Bearer $KEY' -F 'file=@case-file.pdf' -o clean.pdf
New keys come with 100 free operations, no signup: curl -X POST https://api.bigapi.dev/v1/keys. Failed calls cost nothing.
| Name | Meaning |
|---|---|
file required | PDF to clean of JavaScript, auto actions, form fields and attachments. |
flatten | true bakes form fields and comments into the page so what they show stays visible but nothing is interactive any more. Default: true |
removeAttachments | true removes embedded files, which can carry malware or hidden data. Default: true |
removeMetadata | true also clears title, author and producer, e.g. before publishing. Default: false |
Returns application/pdf. Response headers carry the cost (X-BigAPI-Cost) and notes about your input (X-BigAPI-Warnings).
Connect BiGapi as an MCP server: https://api.bigapi.dev/mcp (hosted) or npx -y @bigapi/mcp (local). Then ask in plain words; the agent finds pdf_sanitize on its own.