Classifier

Let Invofox detect the document type automatically.

Let Invofox automatically detect the document type so you don’t need to specify it in every upload.

Step 1 — Upload with the Classifier

Upload the document without a type and set "useClassifier": true in the info field. Invofox reads the document and detects its type before extraction begins.

cURL
curl -X POST https://api.invofox.com/v1/ingest/uploads \
-H "x-api-key: $INVOFOX_API_KEY" \
-F "files=@document.pdf" \
-F 'info={"useClassifier":true}'

Step 2 — Read the detected type

You retrieve the result exactly like the standard flow — polling or webhooks, see Integrating Invofox. The only difference is the type field of the processed document: Invofox fills it with the detected type — the Document Type’s alias if it has one, or its id if not.

Document with detected type
{
"result": {
"_id": "66d71d63c9d0d2adc038b076",
"type": "6a338ee0fdcde8d97ac96784", // ← the Document Type's alias, or its id if no alias is set
"name": "document.pdf",
"publicState": "approved",
"confidence": "high",
"data": { "...": "extracted fields" }
}
}

Both the alias and the id are managed in Invofox — you don’t set them at upload time.

type can also come back as "other" when the document doesn’t match any of your configured types. What happens then is a configuration choice on your environment: either the document is left as "other" and not processed (publicState: "discarded", no data extracted), or it’s routed to a default type and extracted anyway. To choose this behavior, contact your Invofox point of contact.