{"success":true,"data":{"slug":"authentication-overview","title":"Authenticating against the Apier API","jurisdiction":"Norway","summary":"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.","body":[{"heading":"The three auth modes","content":"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."},{"heading":"API keys","content":"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."},{"heading":"Scopes","content":"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."},{"heading":"No government credential on the agent's side","content":"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:*"],"notes":"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":[{"code":"AUTH_MISSING","meaning":"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."},{"code":"SCOPE_MISSING","meaning":"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."},{"code":"RATE_LIMIT_EXCEEDED","meaning":"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_apis":["admin.keys.create","admin.keys.list","admin.keys.revoke","company.authority"],"related_topics":["maskinporten","altinn-system-user","error-401-troubleshooting"],"related_mcp_tools":["get_public_obligations","get_public_deadlines","explain_compliance_error","get_exchange_rate"],"last_verified":"2026-10-21","source_authority":"Apier","source_url":"https://www.apier.no/docs","schema_version":"1.0.0"},"_meta":{"rulebook_version":"1.0.0","data_freshness":"2026-10-21T00:00:00.000Z","last_verified":"2026-10-21T00:00:00.000Z","source":"apier.no","schema_version":"1.0.0","response_timestamp":"2026-12-03T00:31:42.619Z","data_source":"Apier","response_hash":"sha256:546f90a374df549c762686da2c434f0d86cb865ede583d00eef21e3ee49c2c74"}}