> 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.

# Feedback loop

> Use PUT /documents/{id} to send corrected field values or the right document type back to Invofox — every correction feeds model training and makes future extractions more accurate, automatically.

Send corrected field values back to Invofox and every correction makes your future extractions more accurate — automatically, with no extra work.

## Why corrections exist

Invofox extracts data automatically, but no AI is perfect — a field may be read wrong, or, if you use the Classifier, the detected `type` might not be the one you expected. Sending the correct values back fixes the document and **feeds the result into model training**, so Invofox keeps improving over time — automatically, with no extra configuration.

<Note>
**Enterprise plans:** documents you send corrections on may not count toward your usage — contact [support@invofox.com](mailto:support@invofox.com).
</Note>

## What you can correct

Everything goes through a single endpoint — `PUT /documents/{id}`. In the body you can send `data` (corrected field values), `type` (the right document type, if the Classifier got it wrong), or both at once. Send only what's wrong.

<div className="ivf-endpoint"><span className="ivf-method ivf-method-put">PUT</span><span>https://api.invofox.com/documents/{id}</span></div>

**`cURL`**

```bash title="cURL"
curl -X PUT https://api.invofox.com/documents/{id} \
  -H "x-api-key: $INVOFOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "<TYPE_ID_OR_ALIAS>",
    "data": {
      "totalAmount": { "value": "1210.00" },
      "issueDate":   { "value": "2024-05-10" }
    }
  }'
```

- **Fields** (`data`) — include only the fields you're fixing, each as `{ "value": ... }`.
- **Type** (`type`) — a Document Type id or alias. Changing the type re-extracts the document under the new Document Type, so its fields will match it.

The endpoint returns the updated document. Every correction is fed back into model training, helping Invofox improve future extractions — no extra configuration required.