> ## Documentation Index
> Fetch the complete documentation index at: https://filecheck.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Rule

> A Rule is the intake gate — what customers may upload, how many files, and how each file is checked while they wait.

A **Rule** is the customer-facing **intake gate**. It describes what a customer is allowed to upload for a given product, drop-zone, or API endpoint, and decides — *synchronously, while the customer waits* — whether each file is accepted, accepted with warnings, or rejected.

A Rule covers exactly four things: **cardinality** (how many files), **acceptance** (which file types), **preflight** (the check to run per type), and **onFail** (what to do when a check fails). It does not describe what happens after acceptance — fixing, optimizing, merging, exporting all belong to the [Workflow](https://filecheck.io/docs/configuration/workflows.md). Rules live in **Library → Upload Rules**.

[How an Upload Rule works](https://cdn.filecheck.io/videos/rule.html)

Where a Rule sits: the intake gate inside a workflow that's assigned to a product

Library → Upload Rules

## Create one

**1. Open the Library**

Go to **Library → Upload Rules**. Clone a **template** that's close to your product, or click **New Upload Rule**.

**2. Name it and add instructions**

Give the rule a clear **title**. The optional **upload instructions** are shown to customers in the upload area.

**3. Set cardinality**

Choose how many files the customer must provide (below).

**4. Accept file types**

Add each file type you accept, with an optional max size and an optional check (below).

**5. Save**

Click **Save**. The rule can now be assigned to a Workflow.

Edit Upload Rule — cardinality and accepted file types

## Cardinality: how many files

**Cardinality** is how many files the rule requires and allows. Two modes:

> [card] Count range
>
> A **MIN** and **MAX** — for example 1–1 for a single artwork, or 1–4 to allow up to four. The customer must provide at least MIN before the job can proceed.

> [card] Named slots
>
> A defined role per file — for example *Front* and *Back* for a double-sided card. Each slot is its own labelled drop target.

## Accepted file types

Click **Add File Type** for each type you accept (PDF, PNG, JPG…), and optionally set a **max file size**. For each type you can decide whether — and how — to check the file.

### Preflight or validation

Toggle **Run a preflight or a validation check against uploaded file**, then pick what runs. This is the only check performed while the customer waits, so it stays fast; heavier transforms happen later in the Workflow.

> [card] Preflight against a Profile
>
> Choose a [Preflight Profile](https://filecheck.io/docs/configuration/preflight.md) — a **PDF** type lists PDF profiles, a raster type lists Raster profiles. The file is checked against that profile's checks.

> [card] Validation against a standard
>
> Choose a conformance standard instead — **PDF/A** (1a–4f) or **PDF/UA** (accessibility). The file is validated for conformance rather than checked against your custom profile.

> [!NOTE]
>
> Preflight and validation are mutually exclusive per file type — you pick one. Only PDF and raster types can be checked; other types (vector, office) are converted to PDF at intake and processed downstream.
>
> **TODO(filecheck): list the exact vector and office formats accepted for auto-conversion at intake.**

### If the check fails

Set the **onFail** policy per file type:

| Policy | Result |
| - | - |
| **Reject** | The file is blocked; the customer can't proceed until it passes. |
| **Accept with warnings** | The file proceeds, flagged with warnings. |
| **Manual review** | The file is held for an admin to review before it proceeds. |

This policy is what Filecheck collapses into the `canProceed` flag your store reads. See [Jobs](https://filecheck.io/docs/concepts/jobs.md).

> [!NOTE]
>
> **Two layers decide the outcome.** Each check inside a Preflight Profile has its own [action](https://filecheck.io/docs/configuration/preflight.md#the-four-actions) (Reject / Warn / Auto-fix / Off), and the Rule adds this overall **onFail** policy on top. When they disagree — for example a check set to **Reject** under a Rule set to **Accept with warnings** — the resolved outcome is:
>
> **TODO(filecheck): document which layer wins when a check action and the Rule's onFail policy disagree.**

> [card] [Next: add this Rule to a Workflow](https://filecheck.io/docs/configuration/workflows.md)
>
> Assign the rule at a workflow's intake stage and define the processing that follows.

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
