Arbetsflödes-API
Alla slutpunkter kräver en inloggad session (cookie) om inget annat anges. Svaren är JSON: { ok: true, data } eller { ok: false, error }. Vanliga fel: 400 validering, 401 oautentiserad, 403 förbjuden, 404 hittades inte, 429 hastighetsbegränsad, 502/503 uppströms. Offentliga /api/v1-slutpunkter autentiseras med Authorization: Bearer pdflean_… och måste skicka JSON som innehållstyp.
På den här sidan
Arbetsflöden
| Metod | Sökväg | Beskrivning |
|---|---|---|
| GET | /api/workflows | Lista dina arbetsflöden |
| POST | /api/workflows | Skapa ett arbetsflöde (utkast) |
| GET | /api/workflows/:id | Hämta ett arbetsflöde |
| PUT | /api/workflows/:id | Uppdatera ett arbetsflöde (utkast, version+1) |
| DELETE | /api/workflows/:id | Ta bort ett arbetsflöde |
| POST | /api/workflows/:id/publish | Publicera en version |
| GET | /api/workflows/:id/versions | Lista versioner |
| POST | /api/workflows/:id/versions/:version/restore | Återställ en version |
Triggers & krokar
| Metod | Sökväg | Beskrivning |
|---|---|---|
| GET | /api/workflows/triggers | Lista triggers |
| POST | /api/workflows/triggers | Skapa en trigger (webhook/schema/e-post/drive) |
| POST | /api/workflows/triggers/:id/run | Kör en trigger nu |
| DELETE | /api/workflows/triggers/:id | Ta bort en trigger |
| POST | /api/workflows/hook/:token | Inkommande webhook (token-autentisering, ingen session; JSON-brödtext) |
Körningar & Granskningar
| Metod | Sökväg | Beskrivning |
|---|---|---|
| POST | /api/workflows/runs | Skapa en körning (köad) |
| GET | /api/workflows/runs | Lista körningar |
| GET | /api/workflows/runs/:id | Körningsdetaljer och steg |
| POST | /api/workflows/runs/:id/retry | Försök igen med en misslyckad/köad körning |
| GET | /api/workflows/reviews | Väntande mänskliga granskningar |
| POST | /api/workflows/reviews/:id | Godkänn/avvisa en granskning |
Molnbrygga
| Metod | Sökväg | Beskrivning |
|---|---|---|
| GET | /api/workflows/cloud/status | Status för fristående VPS-brygga |
| POST | /api/workflows/cloud/convert | Office → PDF via fristående VPS (LibreOffice) |
| POST | /api/workflows/cloud/ocr | OCR via fristående VPS (Tesseract) |
| POST | /api/workflows/cloud/extract | Extrahera faktura-/generiska fält från PDF (pdfjs + regler) |
Arkiv & lagringstid
| Metod | Sökväg | Beskrivning |
|---|---|---|
| GET | /api/workflows/archive | Lista arkiverade dokument och kedjeintegritet |
| POST | /api/workflows/archive | Arkivera ett dokument (base64, SHA-256-hashkedja) |
| GET | /api/workflows/archive/:id/verify | Verifiera arkivets hashkedja |
| GET | /api/workflows/archive/export | Exportera CSV för arkivrevision (inkluderar tombstones) |
| POST | /api/workflows/archive/:id/hold | Ange/ta bort juridiskt bevarande |
| POST | /api/workflows/archive/:id/compliance | Aktivera oåterkalleligt WORM-efterlevnadslås |
| DELETE | /api/workflows/archive/:id | Ta bort ett arkiv (blockerat under juridiskt bevarande) |
Offentligt API v1
| Metod | Sökväg | Beskrivning |
|---|---|---|
| GET | /api/v1/openapi.json | OpenAPI 3.1-specifikation (publik, ingen auth) |
| GET | /api/v1/me | Nuvarande ägare av API-nyckel (Bearer-nyckel) |
| GET | /api/v1/usage | Användningspanel: saldo, 30-dagarshistorik, senaste anrop |
| GET | /api/v1/workflows | Lista arbetsflöden (scope workflow.read) |
| GET | /api/v1/workflows/:id | Hämta ett arbetsflöde (scope workflow.read) |
| POST | /api/v1/workflows/:id/run | Köa en körning (scope workflow.run) |
| GET | /api/v1/runs | Lista körningar (scope workflow.read) |
| POST | /api/v1/pdf/merge | Sammanfoga PDF-filer (scope pdf.merge; 2–10 base64-filer) |
| POST | /api/v1/pdf/split | Behåll valda sidor (scope pdf.split; intervall som "1-3,5") |
| POST | /api/v1/pdf/compress | Strukturell komprimering av en PDF (scope pdf.compress) |
| GET | /api/v1/jobs/:id | Jobbstatus (gratis) |
| GET | /api/v1/jobs/:id/download | Ladda ner ett jobbresultat (gratis) |
| POST | /api/v1/convert/office | Konvertera Office/ODF-dokument (scope pdf.convert) |
| POST | /api/v1/convert/linearize | Linearera en PDF för snabb webbvisning (scope pdf.convert) |
| POST | /api/v1/convert/typst | Kompilera Typst/Markdown-källkod till PDF (scope pdf.convert) |
| POST | /api/v1/ocr | OCR-skanna en inskannad PDF till en sökbar PDF (scope pdf.ocr) |
| POST | /api/v1/ocr/text | OCR-skanna en enskild bild till text (scope pdf.ocr) |
| POST | /api/v1/validate/pdfa | PDF/A-kompatibilitetskontroll (scope pdf.validate) |
| POST | /api/v1/validate/pdfua | PDF/UA-tillgänglighetskontroll (scope pdf.validate) |
| POST | /api/v1/validate/signature | Verifieringsrapport för digital signatur (scope pdf.validate) |
| POST | /api/v1/sign | PAdES digital signatur (scope pdf.sign; valfritt PEM-nyckelpar) |
| POST | /api/v1/redact | Sann redigering av textmatchningar eller områden (scope pdf.redact) |
| POST | /api/v1/extract | Text- och regelbaserad fältextraktion (scope pdf.extract) |
| POST | /api/v1/docling | Strukturerad layoutanalys via Docling (scope pdf.extract) |
| POST | /api/v1/scan/pii | Skanna text efter personlig 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.
Top up API credits in your account (from $5, never expires)
| Method | Endpoint | Credits |
|---|---|---|
| GET | /jobs/:id | 0 per call |
| GET | /jobs/:id/download | 0 per call |
| GET | /me | 0 per call |
| GET | /runs | 0 per call |
| GET | /usage | 0 per call |
| GET | /workflows | 0 per call |
| GET | /workflows/:id | 0 per call |
| POST | /ai/chat | 3 per call |
| POST | /ai/extract | 5 per call |
| POST | /ai/pii-detect | 4 per call |
| POST | /ai/summarize | 3 per call |
| POST | /ai/translate | 3 per call |
| POST | /convert/linearize | 1 per call |
| POST | /convert/office | 2 per call |
| POST | /convert/typst | 1 per call |
| POST | /docling | 3 per call |
| POST | /extract | 2 per call |
| POST | /ocr | 3 per page |
| POST | /ocr/text | 1 per call |
| POST | /pdf/compress | 1 per call |
| POST | /pdf/merge | 1 per call |
| POST | /pdf/split | 1 per call |
| POST | /redact | 3 per call |
| POST | /scan/pii | 2 per call |
| POST | /sign | 5 per envelope |
| POST | /validate/pdfa | 2 per call |
| POST | /validate/pdfua | 2 per call |
| POST | /validate/signature | 2 per call |
| POST | /workflows/:id/run | 1 per call |
| ai.chat | 2 per call | |
| convert.html_to_pdf | 4 per page | |
| convert.office_to_pdf | 10 per page | |
| convert.pdf_to_office | 12 per page | |
| convert.pdfa | 8 per page | |
| esign.envelope | 750 per envelope | |
| pdf.ocr | 3 per page | |
| pdf.ocr.high | 8 per page |