Programmatically upload PDFs, detect fields, and generate editable forms.
Authentication
Include your API key in the X-API-Key header with every request.
curl -H "X-API-Key: fp_your_key_here" https://smartcontractpilot.com/smartForm/documents/doc_id/fields
Endpoints
POST
/documents
Upload a PDF/image and analyze it. Returns document ID and field count.
curl -X POST -F "file=@form.pdf" https://smartcontractpilot.com/smartForm/documents
GET
/documents/{id}/fields
Get the full field schema (IDs, types, positions, metadata).
POST
/documents/{id}/generate
Generate an editable PDF. Options: ?flatten=true, ?password=secret
POST
/documents/{id}/generate-filled
Generate PDF with values pre-filled. Send JSON body: {"fieldValues": {"field_id": "value"}}
GET
/documents/{id}/download
Download the generated PDF file.
POST
/batch/upload
Upload multiple files at once. Max 20 files.
POST
/mailmerge/{id}/generate-merged
Mail merge — upload CSV, get ZIP of filled PDFs.
POST
/pdf-tools/merge
Merge multiple PDFs into one.
POST
/pdf-tools/split
Split a PDF into individual pages (returns ZIP).
POST
/pdf-tools/rearrange?page_order=3,1,2
Rearrange pages in a PDF.