Strip the invisible: JavaScript, open-actions, form fields, embedded files and metadata (author, dates) are removed, the file is rewritten. sanitize_removed lists what went, nothing_found says it was clean.
export KEY=bigapi_… # your key, once per terminal
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 | Removes title, author, producer, creation and modification date and XMP metadata. On by default since 2026-10-21; set false to keep them. Default: true |
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.