Skip to content
ScrubFiles

API

Upload a PDF, image, or text file and receive a copy with metadata stripped. Sanitize routes use a Bearer key only - session cookies are ignored.

Version 1 · Content is never stored on our servers.

Base URL

https://scrubfiles.com/api/v1

Authentication

Mint a key in the dashboard. The secret is shown once. Send it on every sanitize request:

Authorization: Bearer ds_live_<64 hex characters>
HeaderRequiredDescription
AuthorizationYes (sanitize)Bearer token. Format ds_live_ + 64 hex chars.
AcceptNoapplication/json for JSON; otherwise the cleaned file bytes.
CookieIgnoredSanitize routes never use the dashboard session cookie.
POST/sanitize

Strip metadata from a single file. Body is multipart form data.

Request body

FieldTypeDescription
fileFileRequired. JPEG, PNG, WEBP, PDF, or UTF-8 text. Max 50 MB.
groupsstringOptional comma-separated strip groups (gps,author,revisions,pii,device,dates,attachments). Default: all.
rulesstringOptional JSON array of { pattern, flags, replacement }.

Example

curl -X POST https://scrubfiles.com/api/v1/sanitize \
  -H "Authorization: Bearer ds_live_…" \
  -H "Accept: application/json" \
  -F file=@resume.pdf

Responses

StatusBody
200 + Accept: application/json{ "fileBase64": "…", "report": { … } }
200 (default)Cleaned file bytes. Header X-DataScrub-Report is base64 JSON.
401{ "error": "unauthorized" }
403{ "error": "forbidden" }
413{ "error": "too_large" }
415{ "error": "unsupported" | "polyglot" | … }
429{ "error": "rate_limited", "retryAfterSec": 1 }
POST/sanitize/batch

Clean many files in one request. Send a zip as file or multiple file parts.

ConstraintValue
Files per request25
Zip size200 MB
Uncompressed zip250 MB, ratio ≤ 20:1
Nested zip / Zip-SlipRejected (415)
curl -X POST https://scrubfiles.com/api/v1/sanitize/batch \
  -H "Authorization: Bearer ds_live_…" \
  -F file=@folder.zip \
  -o datascrub.clean.zip

Response is a zip containing cleaned files plus manifest.json.

GET/keys

List keys for the signed-in dashboard user (session cookie). Sanitize Bearer keys cannot call this.

POST /keys - mint a key. JSON { "name": "workbench" }. Secret returned once.

DELETE /keys?id=RECORD_ID - revoke.

GET/rules

List custom redaction rules for the signed-in user.

PUT /rules - replace all rules. Max 50 patterns, 200 characters each. Nested quantifiers are rejected.

{ "rules": [{ "pattern": "\\b[A-Z]{2}\\d{6}\\b", "flags": "g", "replacement": "[id]" }] }
GET/usage

Daily and monthly file counts for each of your keys. Session cookie required.

Errors

JSON body is { "error": "<code>" } unless noted.

HTTPCodeWhen
401unauthorizedMissing or malformed Bearer token
403forbiddenKey revoked or not yours
413too_largeFile or zip over the size cap
415unsupported / polyglot / zip_slipType not on the allowlist, or hostile archive
422encrypted / pages / pixels / timeoutEncrypted PDF, too many pages, image too large, or per-file timeout
429rate_limitedRPM, burst, concurrency, or daily/monthly quota

Rate limits

Applied per API key. Successful responses include:

HeaderMeaning
X-RateLimit-Limit120 requests per sliding minute
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetUnix time when the window rolls
X-RateLimit-FileQuota-DayFiles left today (UTC)
Retry-AfterSeconds to wait (429 only)
QuotaValue
Requests / minute120
Burst20 tokens, refill 2/s
Concurrent5
Files / UTC day2,000
Files / UTC month20,000
Per file50 MB, 15s
Request60s
API: sanitize PDFs and images | ScrubFiles