Discovery

Resolve a structured Apier compliance error code into a Norwegian-bokmål Explanation envelope

Zero-auth, rate-limited per-IP (Category A — 1000/min soft cap). Wraps the existing Compliance Explainer over HTTP so agents that received a structured error from any /v1/* endpoint can resolve it into a one-line summary, a 1–3 sentence why, an ordered list of fix_steps, an optional Apier / Altinn / Skatteetaten / Brønnøysund relevant_link, an optional Lovdata-style legal_basis, and an optional handover block (who / where / what / why) for errors a human must resolve.

Pure static lookup over a closed catalogue (EXPLAINER_ERROR_CODES, 40 codes today across auth, validation, scope, upstream, idempotency, action-execute, government, and reliability domains). Deterministic: same (error_code, context) → byte-identical Explanation. The optional context object carries placeholder values (org_number, role, scope, field, upstream_system) that the explainer interpolates into the bokmål text — missing values fall back to a Norwegian 'ukjent <noun>' rather than leaking placeholder syntax.

Unknown error_code returns 400 VALIDATION_FAILED; the offending value is NEVER echoed in the response body (information-disclosure mitigation).

post/api/v1/explain

Request

  • Base URL: https://www.apier.no
  • URL: https://www.apier.no/api/v1/explain
  • Auth: none required

Request body

error_codestring required

One of EXPLAINER_ERROR_CODES, the codes the Compliance Explainer covers. GET /api/v1/errors lists every Apier error code; the explainer covers a subset of them, and a code outside that subset is rejected with 400 VALIDATION_FAILED without echoing the value. The most frequently asked are AUTH_INSUFFICIENT_ROLE, AUTH_NO_DELEGATION, VALIDATION_FAILED, SCOPE_MISSING, RATE_LIMIT_EXCEEDED, NOT_FOUND, UPSTREAM_UNAVAILABLE, IDEMPOTENCY_KEY_MISMATCH, IDEMPOTENCY_IN_PROGRESS.

context_org_numberstring

Flat form of context.org_number: the organisation the error relates to (9 digits). The flat context_* fields mirror the MCP tool's advertised arguments; mixing them with the nested context object is rejected with 400 VALIDATION_FAILED.

context_scopestring

Flat form of context.scope: scope token interpolated into the bokmål explanation. Cannot be combined with the nested context object.

context_rolestring

Flat form of context.role: role code interpolated into the explanation. Cannot be combined with the nested context object.

context_fieldstring

Flat form of context.field: field name interpolated into the explanation. Cannot be combined with the nested context object.

context_upstream_systemstring

Flat form of context.upstream_system: upstream system name interpolated into the explanation. Cannot be combined with the nested context object.

Response

Resolved Explanation envelope.

successtrue required

Example response

{
  "_meta": {
    "rulebook_version": "v1.0.0",
    "source": "apier.no",
    "data_source": "Brønnøysund Enhetsregisteret + Apier Universal Rulebook",
    "schema_version": "1.0.0",
    "legal_basis": "NLOD — public registry reuse",
    "response_timestamp": "2026-04-24T12:00:00.000Z",
    "response_hash": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "source_snapshot_id": "brreg-2026-04-24T02:00:00.000Z",
    "cost_nok": 0.5,
    "wallet_remaining_nok": 9.5,
    "spend_cap_remaining_nok": 12.5
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.