Skip to Content

Upload, detect and fill step by step

Keep the document in AppliFlo, see every field with its id, fill by id and download the filled PDF.

Use this flow when you want to see the fields before filling, fill the same document more than once, or send it for signature afterwards. It takes four calls.

You need a key with the read and draft scopes.

Upload the document

Send a PDF or a Word file (DOCX) in the multipart field file, up to 20 MB. A DOCX is turned into a PDF.

curl -X POST https://appliflo.com/api/v1/documents \
  -H "Authorization: Bearer $APPLIFLO_API_KEY" \
  -H "Idempotency-Key: upload-lease-7731" \
  -F "file=@lease-application.pdf"

The reply is 201 with data.id, data.name and data.status (draft).

Detect the fields

curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/detect \
  -H "Authorization: Bearer $APPLIFLO_API_KEY"

The reply lists data.fields and the choice questions in data.groups. Each field has:

KeyWhat it tells you
idThe id you fill and correct it by.
label_textThe label printed on the form.
semantic_typeWhat kind of value it takes, such as date, email, checkbox or signature.
flaggedtrue when AppliFlo is unsure about it. Check it before you fill.
page, bboxWhere it is.

data.flagged_count says how many fields need a look. data.vision_skipped is true when the month's AI pages ran out and only built-in fillable fields were found. You can read the fields again later with GET /api/v1/documents/{id}/fields.

Fill by field id

Send values keyed by field id. For a choice question, use its group id from groups[].id and give one option, or a list for a question that allows several.

curl -X POST https://appliflo.com/api/v1/documents/$DOCUMENT_ID/fill \
  -H "Authorization: Bearer $APPLIFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":{"fld_full_name":"Lan Nguyen","fld_dob":"1991-04-17","grp_title":"Ms"}}'

Use the real ids from step 2 in place of fld_full_name and the others. data.results has one entry per field, with the same statuses as one-shot fill. data.groups has one entry per choice question. If a choice answer is not one of the question's options, the call is refused with 422 and nothing is written.

Download the filled PDF

Ask for a download link with artifact=filled. The link is short-lived, so fetch the file straight away.

curl "https://appliflo.com/api/v1/documents/$DOCUMENT_ID/download?artifact=filled" \
  -H "Authorization: Bearer $APPLIFLO_API_KEY"

Next

On this page