Skip to content

Knowledge Catalog

Authenticating against the Apier API

Apier has three auth modes: none for public infrastructure, a Bearer API key for company data, and an operator admin key. Government auth stays server-side.

Jurisdiction: Norway · Verified against Apier as of 2026-10-21

The three auth modes

Category A public-infrastructure endpoints (public obligations/deadlines, agent tools, the capabilities manifest) take no Authorization header at all and are rate-limited softly per IP — they exist for discoverability. Category B company-data endpoints require a consumer API key in the standard Authorization: Bearer header on every tier, because the records carry personal-adjacent data (board members, signaturrett, prokura). Operator endpoints use a separate admin secret and cannot be called with a consumer key.

API keys

Keys are presented as Authorization: Bearer apr_free_<your_key_here>; the prefix names the tier (apr_free_, apr_starter_, apr_pro_ or apr_ent_), and there is no separate test or live key type. Server-side they are stored only as SHA-256 hashes, never plaintext. A consumer can hold at most 3 active keys, which enables zero-downtime rotation: create the new key, cut traffic over, then revoke the old one. Rate limits apply per key, not per IP.

Scopes

Every key carries a scopes array (default read:*). The assignable vocabulary is read:brreg, read:digdir, read:norgesbank, read:changes, read:audit, read:rulebook, subscribe:webhooks, and admin:keys; the action-segment wildcard read:* grants any read scope. Write prefixes (write:*, act:*, delegate:*) are reserved and not assignable at v1 — an agent's key can never approve its own binding writes. read:altinn and fullmakt:write are no longer issued (2026-10-21): the surfaces they gated are withdrawn. The capabilities endpoint exposes the assignable scopes for discovery.

No government credential on the agent's side

The consumer's API key is the only credential an agent manages. Apier reads open register data with its own credentials and holds no Maskinporten client or Altinn System User on a customer's behalf; it does not broker delegations or check Altinn rights (withdrawn 2026-10-21). The register's coded signing rules for the company are read from Brønnøysund at the company authority endpoint.

Use cases

  • Choose the right auth mode for an integration: start keyless on Category A, add a key for company data
  • Rotate a key with zero downtime using the max-3-active-keys overlap
  • Scope keys to least privilege (e.g. read:brreg only) for a verification-only agent

Requirements

  • Nothing for Category A public endpoints
  • A registered consumer and an API key for Category B company data (all tiers including Free)
  • The appropriate scope on the key for each endpoint family

Authentication

Method: api_key · Scopes: read:*

This topic describes the auth model itself. Keys are minted and revoked via the account key endpoints; scope checks write an audit row on every evaluation.

Common errors

  • AUTH_MISSING

    No usable Authorization header reached the API. A malformed Bearer value (whitespace, line breaks, paste artifacts) is stripped at the HTTP layer per RFC 7230 and surfaces as this code rather than a format error.

    Fix: Send Authorization: Bearer <key> as a single clean line; validate locally that the key file is well-formed before use.

  • SCOPE_MISSING

    The key is valid but lacks the scope the endpoint requires.

    Fix: Mint or update a key carrying the required scope (e.g. read:brreg) and retry.

  • RATE_LIMIT_EXCEEDED

    The per-key tier rate limit was hit.

    Fix: Back off and retry after the Retry-After header's delay, or upgrade the tier.

Related topics

Related APIs

These are capability ids; resolve each against the machine-readable manifest at /api/v1/capabilities for the endpoint, auth mode, and tier.

  • admin.keys.create
  • admin.keys.list
  • admin.keys.revoke
  • company.authority

Related MCP tools

Registered tools on the Apier MCP server.

  • get_public_obligations
  • get_public_deadlines
  • explain_compliance_error
  • get_exchange_rate