First request: sync extraction
This example calls POST /v2/process/idp/documentExtract, uploads a file, and extracts fields with mode=vision (the default mode). Both vision and layout modes take one fixed schema in extract_fields; for layout extraction, explicitly pass mode=layout.
bash
curl --location --request POST 'https://api-server.compdf.com/server/v2/process/idp/documentExtract' \
--header 'x-api-key: <your-public-key>' \
--form 'file=@/path/to/handwriting.pdf' \
--form 'mode=vision' \
--form 'extract_fields={"name":"Form","keys":{"Name":{"prompt":"Applicant name","mapping":null}},"tableHeaders":{}}'| Parameter | Required | Description |
|---|---|---|
file | Yes | Source PDF, image, or office document |
mode | No | layout or vision; defaults to vision |
extract_fields | Yes | JSON string of a single schema used by both vision and layout; an empty schema triggers AI field auto-extraction |
enable_grounding | No | Whether to return bbox grounding, default true; this field only needs to be passed when using layout mode. |