vokavimas API

Upload a PDF — get back the list of recipients to mail it to. · v0.1.0

One endpoint. Send a document, receive a JSON array of recipients (who to mail, and which page each one's documents start on) for batch enveloping.

POST  https://vokavimas.softa.lt/v1/extract

Quick start

curl -X POST https://vokavimas.softa.lt/v1/extract -F "file=@document.pdf"

Response — a JSON array, one entry per recipient, in page order:

[
  { "page_number": 1, "name": "Vardenis Pavardenis",
    "address": "Pavyzdžio g. 1-2, 00001 Vilnius" },
  { "page_number": 3, "name": "Vardenė Pavardenė",
    "address": "Pavyzdžio g. 3-4, 00002 Kaunas" }
]

page_number is where that recipient's documents start; every page up to the next entry belongs to the same recipient (one envelope).

Sending the document

WayHow
Upload (usual)multipart form field file = the PDF
By URL?url=https://.../doc.pdf — the server fetches it
Raw bodyContent-Type: application/pdf, the PDF bytes as the body

Options (query parameters)

ParameterEffect
?full=truereturn { customers, review, meta } instead of the bare list
?split_names=truesplit the name into given-name + a surname field
?mode=asyncreturn a job_id at once; poll GET https://vokavimas.softa.lt/v1/jobs/<id> (for very large files)

Response fields

FieldDescription
page_number1-based page where this recipient's documents start
namerecipient name, verbatim (given name only when split_names=true)
addressfull postal address

Errors

StatusMeaning
200OK
422file isn't a usable PDF
413file too large
400no document in the request
401missing/invalid key (only when auth is enabled)

Authentication

If the service is configured with API keys, send one in the X-API-Key header; otherwise the API is open.

Good to know

The call is synchronous: it blocks until done and returns the finished JSON (no streaming, no polling). A 2000-page invoice takes ~25 s; large scanned files can take a few minutes — use a generous client read timeout, or ?mode=async.

Interactive explorer: https://vokavimas.softa.lt/docs · this page as PDF.

More examples

# full output + split the name into given-name + surname
curl -X POST "https://vokavimas.softa.lt/v1/extract?full=true&split_names=true" \
     -F "file=@document.pdf"
# Python
import requests

r = requests.post("https://vokavimas.softa.lt/v1/extract",
                  files={"file": open("document.pdf", "rb")})
recipients = r.json()