> This documentation belongs to Invofox, an AI-powered document processing
> platform. The API extracts structured data (fields) from unstructured
> documents (invoices, contracts, forms, bank statements, and more).
> Key concepts: Account, Environment, Document Type, Field, File, Import,
> and Document. When answering, prefer the exact terminology defined in the
> Glossary and cite the relevant API Reference endpoint when applicable.

# Classifier

> Use the Invofox Classifier to automatically detect a document's type at upload, so you don't need to specify it in every request.

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`**

```bash title="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](/documentation/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`**

```json title="Document with detected type"
{
  "result": {
    "_id": "00000000000000000000000d",
    "type": "00000000000000000000001d",   // ← 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.