API v1 · REST · multipart/form-data

WebFileTools API

Upload and share files directly from your scripts, CI/CD pipelines and automation workflows. Bearer API key, daily quota, JSON response.

Server-side tools (22)

These tools process files on the server. Upload your file via /api/upload then use the returned link directly in your workflow or open it in a browser to process it.

Note: These tools are used via the web interface. For automation, use the dedicated processing endpoints (OCR, PDF compression, PDF→images).

Authentication

Add your key in the Authorization header:

Authorization: Bearer wft_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The key is shown only once at creation — copy it immediately. Create one from your dashboard.

Quotas

PlanCalls / dayReturned header
Free100X-RateLimit-Remaining: 97
ProUnlimited

Exceeded → 429 Too Many Requests

POST /api/upload

Uploads a file, returns a share link.

cURL

curl -X POST https://webfiletools.com/api/upload \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@document.pdf"

Python

import requests

API_KEY = "wft_YOUR_KEY"
with open("document.pdf", "rb") as f:
    r = requests.post(
        "https://webfiletools.com/api/upload",
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"file": f},
    )
print(r.json()["url"])  # https://webfiletools.com/f/xxxxx

JavaScript (Node.js)

import FormData from "form-data";
import fs from "fs";

const API_KEY = "wft_YOUR_KEY";
const form = new FormData();
form.append("file", fs.createReadStream("document.pdf"));

const res = await fetch("https://webfiletools.com/api/upload", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, ...form.getHeaders() },
  body: form,
});
console.log((await res.json()).url);

Response 201

{
  "success": true,
  "token": "abc123def456",
  "filename": "document.pdf",
  "size": 204800,
  "mimeType": "application/pdf",
  "expiresAt": null,
  "url": "https://webfiletools.com/f/abc123def456"
}

Processing endpoints

These endpoints process your files directly, no web interface needed. API key authentication required (scope upload). Results are returned synchronously — no polling required.

POST/api/v1/process/ocr→ JSON

Extracts text from an image (PNG, JPG, TIFF, WebP, BMP) or a PDF. Up to 30 pages.

ParameterTypeDefault
fileform-data (required)
langstringfra+eng
curl -X POST https://webfiletools.com/api/v1/process/ocr \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@scan.pdf" \
  -F "lang=eng"
{ "text": "Extracted content...", "pages": 3, "chars": 1842, "lang": "eng" }
POST/api/v1/process/compress-pdf→ PDF binary

Compresses a PDF using Ghostscript. Returns the compressed PDF as a binary response.

ParameterTypeDefault
fileform-data (required)
qualityscreen · ebook · printer · prepressebook
curl -X POST https://webfiletools.com/api/v1/process/compress-pdf \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@report.pdf" \
  -F "quality=screen" \
  -o report-compressed.pdf

Useful response headers: X-Original-Size, X-Compressed-Size, X-Savings-Percent

POST/api/v1/process/pdf-to-images→ ZIP (PNG)

Converts a PDF to PNG images packed in a ZIP archive. Up to 30 pages.

ParameterTypeDefault
fileform-data (required)
dpiinteger 72–300150
curl -X POST https://webfiletools.com/api/v1/process/pdf-to-images \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@slides.pdf" \
  -F "dpi=200" \
  -o images.zip

Response headers: X-Page-Count, X-DPI

Workflows API

Text-focused endpoint for support automation, useful to classify and reframe tickets without file upload. API key authentication required (scope read, upload or process).

POST/api/workflows/support/auto→ JSON
JSON fieldTypeNotes
rawLogstring (required)Raw ticket log
ticketContextstringOptional free-form context
localefr | enDefault: fr
curl -X POST https://webfiletools.com/api/workflows/support/auto \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rawLog": "ERR 500 /checkout for tenant acme; customer cannot validate cart",
    "ticketContext": "Priority B2B incident",
    "locale": "en"
  }'
{
  "ok": true,
  "result": {
    "anonymized": "...",
    "summary": "...",
    "draftResponse": "...",
    "stats": {
      "ipv4": 2,
      "ipv6": 0,
      "email": 1,
      "domainUser": 1,
      "fqdn": 1,
      "total": 5
    }
  }
}

Possible headers: X-RateLimit-Remaining

Workflow recipes

Not every pack listed on /en/workflows has a public endpoint for each step yet. Still, several flows can already be partially automated with the public endpoints documented above.

1. IT Support / MSP

API is available for the anonymization + summary/draft reply stage through /api/workflows/support/auto. Before/after comparison and final wording remain web-local.

2. Document Compliance

Already automatable today for initial ingestion with /api/v1/process/ocr, then for visual derivation with /api/v1/process/pdf-to-images or output optimization with /api/v1/process/compress-pdf. PDF redaction and PDF/A conversion still remain guided through the web interface.

3. Secure Multi-type Sharing

For API use, the reliable entry point is /api/upload to push a file and retrieve a share link. The one-time encrypted variant and the full separate-secret orchestration are still primarily web-oriented today.

Not exposed as public API yet

Social Marketing and Web Publishing Express mostly rely on 100% browser-local tools. They work well in web auto and guided assistant modes, but they do not yet have dedicated public endpoints.

Error codes

CodeCauseFix
201SuccessRead the url field
400Missing or invalid fileCheck the file field
401Missing or invalid keyCheck Authorization header
403Insufficient scopeRecreate the key with upload scope
413Storage quota exceededUpgrade to Pro
422File rejected (antivirus)File contains a threat
429Daily quota exceededWait until tomorrow or upgrade to Pro
503Antivirus unavailableRetry in a few seconds

Examples

Typical use cases covering upload, processing and automation.

Upload

Daily database backup (bash + cron)

#!/bin/bash
DATE=$(date +%Y-%m-%d)
pg_dump mydb > backup_$DATE.sql
URL=$(curl -s -X POST https://webfiletools.com/api/upload \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@backup_$DATE.sql" | jq -r '.url')
echo "Backup available at: $URL"

Batch upload invoice PDFs (Python)

import os, requests, time

API_KEY = "wft_YOUR_KEY"
for name in os.listdir("./invoices"):
    if not name.endswith(".pdf"):
        continue
    with open(f"./invoices/{name}", "rb") as f:
        r = requests.post(
            "https://webfiletools.com/api/upload",
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={"file": f},
        )
    print(f"{name} → {r.json().get('url')}")
    time.sleep(0.5)

GitHub Actions — publish a build artifact

- name: Publish artifact
  run: |
    URL=$(curl -s -X POST https://webfiletools.com/api/upload \
      -H "Authorization: Bearer ${{ secrets.WFT_API_KEY }}" \
      -F "file=@dist/app.zip" | jq -r '.url')
    echo "Download: $URL" >> $GITHUB_STEP_SUMMARY
OCR

Index scanned contracts into a database (Python)

OCR a full folder and store extracted text in PostgreSQL.

import os, requests, psycopg2

API_KEY = "wft_YOUR_KEY"
conn = psycopg2.connect("dbname=docs user=admin")
cur = conn.cursor()

for pdf in os.listdir("./contracts"):
    if not pdf.endswith(".pdf"):
        continue
    with open(f"./contracts/{pdf}", "rb") as f:
        r = requests.post(
            "https://webfiletools.com/api/v1/process/ocr",
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={"file": f},
            data={"lang": "eng"},
        )
    text = r.json()["text"]
    cur.execute("INSERT INTO contracts (filename, content) VALUES (%s, %s)", (pdf, text))

conn.commit()

Extract text from a screenshot (Node.js)

import FormData from "form-data";
import fs from "fs";

const form = new FormData();
form.append("file", fs.createReadStream("screenshot.png"));
form.append("lang", "eng");

const res = await fetch("https://webfiletools.com/api/v1/process/ocr", {
  method: "POST",
  headers: { Authorization: "Bearer wft_YOUR_KEY", ...form.getHeaders() },
  body: form,
});

const { text, chars } = await res.json();
console.log(`Extracted ${chars} characters:`, text);
PDF compression

Optimize PDFs before email attachment (Python)

Reduce file size before attaching, display compression ratio.

import requests

API_KEY = "wft_YOUR_KEY"

with open("annual-report.pdf", "rb") as f:
    r = requests.post(
        "https://webfiletools.com/api/v1/process/compress-pdf",
        headers={"Authorization": f"Bearer {API_KEY}"},
        files={"file": f},
        data={"quality": "ebook"},
    )

with open("annual-report-compressed.pdf", "wb") as out:
    out.write(r.content)

orig  = int(r.headers["X-Original-Size"])
comp  = int(r.headers["X-Compressed-Size"])
saved = r.headers["X-Savings-Percent"]
print(f"{orig//1024} KB → {comp//1024} KB (-{saved}%)")

Batch compression pipeline (bash)

#!/bin/bash
for f in ./reports/*.pdf; do
  name=$(basename "$f" .pdf)
  curl -s -X POST https://webfiletools.com/api/v1/process/compress-pdf \
    -H "Authorization: Bearer wft_YOUR_KEY" \
    -F "file=@$f" \
    -F "quality=ebook" \
    -o "./reports-compressed/$name-compressed.pdf"
  echo "✓ $name"
done
PDF to images

Generate presentation thumbnails (Node.js)

Convert a PDF to PNGs, extract the first page as a thumbnail.

import FormData from "form-data";
import fs from "fs";
import AdmZip from "adm-zip";

const form = new FormData();
form.append("file", fs.createReadStream("slides.pdf"));
form.append("dpi", "96");  // light DPI for thumbnails

const res = await fetch("https://webfiletools.com/api/v1/process/pdf-to-images", {
  method: "POST",
  headers: { Authorization: "Bearer wft_YOUR_KEY", ...form.getHeaders() },
  body: form,
});

const zipBuf = Buffer.from(await res.arrayBuffer());
const zip = new AdmZip(zipBuf);

// Save only page 1 as thumbnail
zip.extractEntryTo("page-001.png", "./thumbs", false, true);
console.log(`Total pages: ${res.headers.get("X-Page-Count")}`);

Make / n8n automation (cURL)

In an n8n or Make HTTP node, call the endpoint directly.

curl -X POST https://webfiletools.com/api/v1/process/pdf-to-images \
  -H "Authorization: Bearer wft_YOUR_KEY" \
  -F "file=@document.pdf" \
  -F "dpi=150" \
  -o pages.zip

# Unzip pages
unzip -o pages.zip -d ./pages/

Security

  • Never commit your key to Gituse environment variables (.env or CI secrets)
  • Minimal scopeonly enable the permissions you need (e.g. upload only)
  • One key per projectisolate access — if one key leaks, revoke it without affecting others
  • Immediate revocationfrom your dashboard /dashboard/api-keys in seconds
  • Monitor quotacheck X-RateLimit-Remaining to anticipate rate limiting

Ready to automate?

Create your account and get your first API key in under a minute.