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

# Rejected files

> How Invofox reports rejected files (password-protected, corrupt, or unsupported formats) through the file.rejected webhook, and how to handle them in your pipeline.

A rejection is a problem with the file itself — not with the extraction — and Invofox tells you which file failed and why.

A file is rejected when it can't be processed as-is — for example a **password-protected PDF**, a **corrupted file**, or an **unsupported format inside a ZIP** (e.g. a `.pptx` or `.exe`). The file produces no document; instead a `file.rejected` webhook fires with the reason in its `error` field. (A direct upload of an unsupported type is refused up front with a `400`, before anything is created.)

Listen for `file.rejected` to catch these in your pipeline. Your `clientData` is included, so you can correlate the rejection with your own records.

<Warning>
A rejected file fires **only** `file.rejected` — never `document.processed`, and it never appears via polling. If you don't handle this event you'll wait indefinitely for a document that will never arrive.
</Warning>

## Error codes

When a File reaches `rejected` status, its `error` field contains one of the following codes:

| Error code | Description |
| --- | --- |
| `ERR_DOWNLOADING_FILE` | Error downloading file from source |
| `ERR_UNSUPPORTED_FILE_FORMAT` | File format not supported |
| `ERR_UNSUPPORTED_UNCOMPRESSED_FILE_FORMAT` | Uncompressed file format not supported (extracted from an archive) |
| `ERR_ZIP_ENCRYPTED` | ZIP file is password-protected or encrypted |
| `ERR_INSUFFICIENT_CREDITS` | Not enough credits in the account to process this file |
| `ERR_IMAGE_TOO_SMALL` | Image dimensions are below the minimum supported (min 50×50px) |

<Note>Additional error codes may be added in future versions. The code is always returned as a string in the `error` field for programmatic handling.</Note>

The `error` field tells you what happened. Two common cases:

**`file.rejected · password-protected PDF`**

```json title="file.rejected · password-protected PDF"
{
  "type": "file.rejected",
  "id": "000000000000000000000027",
  "timestamp": "2026-06-19T03:15:41.826Z",
  "data": {
    "id": "000000000000000000000027",
    "importId": "000000000000000000000026",
    "status": "rejected",
    "filename": "invoice.pdf",
    "error": "ERR_PASSWORD_PROTECTED",   // ← the PDF is locked with a password
    "clientData": { "internalId": "inv-1234" }
  }
}
```

**`file.rejected · unsupported format inside a ZIP`**

```json title="file.rejected · unsupported format inside a ZIP"
{
  "type": "file.rejected",
  "id": "00000000000000000000002f",
  "timestamp": "2026-06-19T10:59:19.241Z",
  "data": {
    "id": "00000000000000000000002f",
    "importId": "00000000000000000000002e",
    "status": "rejected",
    "filename": "notes.pptx",
    "error": "ERR_UNSUPPORTED_UNCOMPRESSED_FILE_FORMAT",   // ← a .pptx extracted from the ZIP isn't a supported type
    "clientData": { "internalId": "inv-1234" }
  }
}
```