Validate a regulatory action (dry-run)
validate_actionValidate a proposed Norwegian regulatory action (VAT or employer report) without any upstream side effect, catching missing delegations and payload-shape errors before live submission.
Instructions
Run the Apier dry-run validator against a proposed regulatory action without producing ANY upstream side effect — no Maskinporten call, no Altinn / Skatteetaten / NAV submission. Use this BEFORE the live execute path to catch missing delegations and payload-shape errors at zero upstream cost. The verdict carries five prerequisite check slots (each pass / fail / skipped), the overall valid boolean, the DRY_RUN_DISCLAIMER (a pass is NOT a guarantee of upstream success), and the preview echo would_be_payload + preview_notice. Inputs match the /v1/actions/execute body: { org_number (9 digits, MOD-11), action_type (mva_melding | a_melding), period, payload }. The nested payload object is intentional - it mirrors the upstream government payload schema for the action, so it is not flattened. Failure modes: SCOPE_INSUFFICIENT (needs read:actions), VALIDATION_FAILED; the validator never throws. To actually file a (sandbox) VAT return, use submit_vat_return instead. No sandbox mirror — under a sandbox bearer call submit_vat_return instead. Docs: https://www.apier.no/docs/guides/mva-filing
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | Reporting period. mva_melding: `YYYY-T1..T6` (bimonthly), `YYYY-A` (annual), or `YYYY-MM` (monthly). a_melding: `YYYY-MM`. | |
| payload | Yes | The upstream-shaped JSON payload for the action; the route's per-action discriminated Zod owns shape validation. Capped at 64 KiB UTF-8 here. | |
| org_number | Yes | 9-digit Norwegian organisasjonsnummer (passing MOD-11) the proposed action targets. | |
| action_type | Yes | The regulatory action to dry-run — `mva_melding` (VAT return) or `a_melding` (employer report). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _meta | No | ||
| result | Yes | The structured dry-run verdict: the overall `valid` boolean, the five check slots (each pass/fail/skipped with a reason), the DRY_RUN_DISCLAIMER, and the preview echo `would_be_payload` + `preview_notice`. No upstream side effect. | |
| metadata | Yes | ||
| justification | Yes |