API Reference

Workflow API

All endpoints require a signed-in session (cookie) unless noted. Responses are JSON: { ok: true, data } or { ok: false, error }. Common errors: 400 validation, 401 unauthenticated, 403 forbidden, 404 not found, 429 rate-limited, 502/503 upstream. Public /api/v1 endpoints authenticate with Authorization: Bearer pdflean_… and must send a JSON content type.

On this page

Workflows

MethodPathDescription
GET/api/workflowsList your workflows
POST/api/workflowsCreate a workflow (draft)
GET/api/workflows/:idGet a workflow
PUT/api/workflows/:idUpdate a workflow (draft, version+1)
DELETE/api/workflows/:idDelete a workflow
POST/api/workflows/:id/publishPublish a version
GET/api/workflows/:id/versionsList versions
POST/api/workflows/:id/versions/:version/restoreRestore a version

Triggers & Hooks

MethodPathDescription
GET/api/workflows/triggersList triggers
POST/api/workflows/triggersCreate a trigger (webhook/schedule/email/drive)
POST/api/workflows/triggers/:id/runRun a trigger now
DELETE/api/workflows/triggers/:idDelete a trigger
POST/api/workflows/hook/:tokenInbound webhook (token auth, no session; JSON body)

Runs & Reviews

MethodPathDescription
POST/api/workflows/runsCreate a run (queued)
GET/api/workflows/runsList runs
GET/api/workflows/runs/:idRun details and steps
POST/api/workflows/runs/:id/retryRetry a failed/queued run
GET/api/workflows/reviewsPending human reviews
POST/api/workflows/reviews/:idApprove/reject a review

Cloud Bridge

MethodPathDescription
GET/api/workflows/cloud/statusStandalone VPS bridge status
POST/api/workflows/cloud/convertOffice → PDF via standalone VPS (LibreOffice)
POST/api/workflows/cloud/ocrOCR via standalone VPS (Tesseract)
POST/api/workflows/cloud/extractExtract invoice/generic fields from PDF (pdfjs + rules)

Archive & Retention

MethodPathDescription
GET/api/workflows/archiveList archived documents and chain integrity
POST/api/workflows/archiveArchive a document (base64, SHA-256 hash chain)
GET/api/workflows/archive/:id/verifyVerify the archive hash chain
GET/api/workflows/archive/exportExport archive audit CSV (includes tombstones)
POST/api/workflows/archive/:id/holdSet/clear legal hold
POST/api/workflows/archive/:id/complianceEnable irreversible WORM compliance lock
DELETE/api/workflows/archive/:idDelete an archive (blocked under legal hold)

Public API v1

MethodPathDescription
GET/api/v1/openapi.jsonOpenAPI 3.1 spec (public, no auth)
GET/api/v1/meCurrent API key owner (Bearer key)
GET/api/v1/usageUsage dashboard: balance, 30-day history, recent calls
GET/api/v1/workflowsList workflows (scope workflow.read)
GET/api/v1/workflows/:idGet a workflow (scope workflow.read)
POST/api/v1/workflows/:id/runQueue a run (scope workflow.run)
GET/api/v1/runsList runs (scope workflow.read)
POST/api/v1/pdf/mergeMerge PDFs (scope pdf.merge; 2–10 base64 files)
POST/api/v1/pdf/splitKeep selected pages (scope pdf.split; ranges like "1-3,5")
POST/api/v1/pdf/compressStructurally compress a PDF (scope pdf.compress)
GET/api/v1/jobs/:idJob status (free)
GET/api/v1/jobs/:id/downloadDownload a job result (free)
POST/api/v1/convert/officeConvert Office/ODF documents (scope pdf.convert)
POST/api/v1/convert/linearizeLinearize a PDF for fast web view (scope pdf.convert)
POST/api/v1/convert/typstCompile Typst/Markdown source to PDF (scope pdf.convert)
POST/api/v1/ocrOCR a scanned PDF into a searchable PDF (scope pdf.ocr)
POST/api/v1/ocr/textOCR a single image to text (scope pdf.ocr)
POST/api/v1/validate/pdfaPDF/A compliance check (scope pdf.validate)
POST/api/v1/validate/pdfuaPDF/UA accessibility check (scope pdf.validate)
POST/api/v1/validate/signatureDigital signature verification report (scope pdf.validate)
POST/api/v1/signPAdES digital signature (scope pdf.sign; optional PEM key pair)
POST/api/v1/redactTrue redaction of text matches or areas (scope pdf.redact)
POST/api/v1/extractText and rule-based field extraction (scope pdf.extract)
POST/api/v1/doclingStructured layout parsing via Docling (scope pdf.extract)
POST/api/v1/scan/piiScan text for personal information (scope pii.detect)

Credit consumption

Member credits refresh each billing cycle (no rollover) and are spent before purchased credits. Credits are $0.001 each.

MethodEndpointCredits
GET/jobs/:id0 per call
GET/jobs/:id/download0 per call
GET/me0 per call
GET/runs0 per call
GET/usage0 per call
GET/workflows0 per call
GET/workflows/:id0 per call
POST/ai/chat3 per call
POST/ai/extract5 per call
POST/ai/pii-detect4 per call
POST/ai/summarize3 per call
POST/ai/translate3 per call
POST/convert/linearize1 per call
POST/convert/office2 per call
POST/convert/typst1 per call
POST/docling3 per call
POST/extract2 per call
POST/ocr3 per page
POST/ocr/text1 per call
POST/pdf/compress1 per call
POST/pdf/merge1 per call
POST/pdf/split1 per call
POST/redact3 per call
POST/scan/pii2 per call
POST/sign5 per envelope
POST/validate/pdfa2 per call
POST/validate/pdfua2 per call
POST/validate/signature2 per call
POST/workflows/:id/run1 per call
ai.chat2 per call
convert.html_to_pdf4 per page
convert.office_to_pdf10 per page
convert.pdf_to_office12 per page
convert.pdfa8 per page
esign.envelope750 per envelope
pdf.ocr3 per page
pdf.ocr.high8 per page