Explain a compliance error
explain_compliance_errorExplain Apier compliance error codes with a Norwegian-bokmål summary, why, ordered fix steps, legal basis, and optional handover for human-resolved errors. Turn error codes into actionable guidance.
Instructions
Resolve a structured Apier compliance error code into a Norwegian-bokmål Explanation envelope: summary, bokmål why, ordered fix_steps, optional documentation link + legal_basis, and an optional handover block (who / where / what / why) for errors a human must resolve (e.g. AUTH_INSUFFICIENT_ROLE, AUTH_NO_DELEGATION, SCOPE_MISSING) — agent-resolvable errors ship handover: null. Accepts any code from the closed EXPLAINER_ERROR_CODES catalogue — pass whatever code an Apier endpoint returned in an error envelope. Optional flat context_org_number / context_scope / context_role / context_field / context_upstream_system strings carry placeholder values interpolated into the bokmål text; missing values fall back to 'ukjent '. Failure modes: VALIDATION_FAILED on an unknown code; SCOPE_INSUFFICIENT (needs read:rulebook). For a company's live obligations rather than an error explanation, use get_company_obligations instead. No API key? Bearer apier_sandbox_test_ (fresh suffix) serves synthetic fixtures; org numbers: GET /api/v1/sandbox/fixtures. Docs: https://www.apier.no/docs/guides/error-handling
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error_code | Yes | An Apier error code from an error envelope. Full list: apier://tools/explain_compliance_error/guide | |
| context_role | No | Role code interpolated into the explanation. | |
| context_field | No | Field name interpolated into the explanation. | |
| context_scope | No | Scope token interpolated into the bokmål explanation. | |
| context_org_number | No | Organisation the error relates to (9 digits). | |
| context_upstream_system | No | Upstream system name interpolated into the explanation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _meta | No | ||
| result | Yes | The Explainer envelope: summary, bokmål why, ordered fix_steps, optional documentation link + legal_basis, and an optional human handover block. | |
| metadata | Yes | ||
| justification | Yes |