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

# Validation & dry_run

> Validate input locally before any network round-trip — same checks the server runs, available offline.

Every input-bearing method accepts `dry_run=True`. It validates your input and
returns the exact request that *would* be sent — **without touching the
network**:

```python theme={null}
from minerva import Minerva, MinervaValidationError

mc = Minerva()

# Returns the validated request model, no HTTP call.
req = mc.api.enrich(records, match_condition_fields=["linkedin_url"], dry_run=True)
print(req.model_dump())          # exact wire payload

# Invalid input fails fast — before any HTTP call.
try:
    mc.api.enrich([], dry_run=True)        # 0 records → must be ≥ 1
except MinervaValidationError as e:
    print("caught before any API call:", e)
```

Great for checking a batch is well-formed (record limits, allowed
`match_condition_fields`, record shape) before spending a call.

## What gets validated locally

The local validation enforces the same constraints the server does:

* **Record counts** — `enrich` and `resolve` cap at 500 records per call
* **Required fields** — `record_id` on every record, etc.
* **Field types** — strings where strings expected, lists where lists expected
* **Allowed values** — `match_condition_fields` capped at 3, only allowed values

What it **doesn't** check (server-only):

* Billing eligibility (whether your plan covers this endpoint)
* Whether matches will actually be found
* Per-row business rules

Use `dry_run` for shape; trust the server for substance.

## The request models directly

Every method has an underlying pydantic request model — you can construct +
validate it yourself if you want:

```python theme={null}
from minerva import EnrichRequest

req = EnrichRequest.model_validate({
    "records": [{"record_id": "1", "linkedin_url": "..."}],
    "match_condition_fields": ["linkedin_url"],
})
# req is a typed model; req.model_dump() is the JSON wire payload.
```

Useful when you want to drive the validation from your own dict-based
pipeline, generate a JSON Schema, or pre-validate before queueing the call.

## All input-bearing methods take `dry_run`

| Method                             | Returns when `dry_run=True` |
| ---------------------------------- | --------------------------- |
| `mc.api.enrich(...)`               | `EnrichRequest`             |
| `mc.api.resolve(...)`              | `ResolveRequest`            |
| `mc.api.get_li_contact_info(...)`  | `LiContactInfoRequest`      |
| `mc.api.validate_emails(...)`      | `ValidateEmailsRequest`     |
| `mc.api.infer_record_country(...)` | `InferCountryRequest`       |

<Note>
  `mc.api.call(...)` does not take `dry_run` — there's nothing for the SDK to
  validate (the SDK doesn't know the schema of the path you're calling).
</Note>
