Sandbox

Sandbox mirror of /api/v1/company/{org}/audit (API key or sandbox bearer)

Zero-auth sandbox mirror of GET /api/v1/company/{org}/audit. Pagination is a stub: the fixture's audit_entries array is returned in full; pagination.has_more: false always. The full production query-param surface (limit, before, before_id, since, until, action, initiated_by) is documented for shape parity so generated clients can prod→sandbox swap with the same request layer; sandbox returns the static fixture regardless of values per the deterministic-fixture contract.

Write→read merge: under a sandbox bearer, the session's mock filing receipts (recorded under the SAME suffix) are prepended newest-first over the static fixture entries for the filed org — an MVA filing surfaces as a submit_mva row whose details carry session_filing: true, the period, the receipt id and the filed_late flag. Marked via _meta.session_merged + _meta.session_merged_rows; fresh suffixes stay byte-deterministic.

get/api/v1/sandbox/company/{org}/audit

Request

  • Base URL: https://www.apier.no
  • URL: https://www.apier.no/api/v1/sandbox/company/{org}/audit
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Query parameters

limitinteger

Schema mirrors production exactly (integer 1-200, default 50). Sandbox runtime does NOT validate the integer-range bounds and does NOT apply the value; the static fixture's full audit_entries array is returned regardless. The pagination.limit echoed on the response is always the production default (50).

cursorstring

Opaque HMAC-signed continuation token - the CANONICAL pagination idiom. Pass the previous response's pagination.next_cursor back verbatim; a tampered or cross-endpoint cursor is rejected with 400 CURSOR_INVALID. Cannot be combined with the legacy before/before_id tuple.

beforestring date-time

Production keyset cursor companion (ISO 8601 / RFC 3339). Schema mirrors production exactly; format: date-time is non-validating in OpenAPI 3.1, so generated clients see the typing without sandbox runtime enforcement. Sandbox does NOT validate or apply the value (deterministic-fixture model). DEPRECATED: use the opaque cursor parameter instead; this parameter keeps working through the deprecation window (Sunset: 2027-01-31T00:00:00Z) and responses to requests using it carry Deprecation/Sunset/Link headers.

before_idstring uuid

Production keyset cursor id companion (UUID v4). Schema mirrors production exactly; format: uuid is documentation-only at the OpenAPI layer, sandbox does NOT enforce or apply the value. DEPRECATED: use the opaque cursor parameter instead; this parameter keeps working through the deprecation window (Sunset: 2027-01-31T00:00:00Z) and responses to requests using it carry Deprecation/Sunset/Link headers.

sincestring date-time

Production lower-bound timestamp filter (ISO 8601). Schema mirrors production exactly; sandbox does NOT validate or apply the value.

untilstring date-time

Production upper-bound timestamp filter. Schema mirrors production exactly; sandbox does NOT validate or apply the value.

action'delegation.create' | 'delegation.revoke' | 'approval_token.mint' | 'approval_token.used' | 'api_key.create' | 'api_key.revoke' | 'gov_api.call' | 'registry.upsert' | 'system.cron_run' | 'privacy.dsr' | 'subscription.create' | 'subscription.delete' | 'webhook.delivered' | 'dry_run_execute' | 'risk_elevated_response' | 'risk_elevated_shadow' | 'risk_pattern_override_applied' | 'submit_mva_started' | 'submit_mva' | 'submit_mva_failed' | 'execute_authorization_failed' | 'rate_limit_blocked' | 'idempotency_replay' | 'altinn.list_acting_capacity' | 'brreg.get_company_profile' | 'write_conflict_blocked'

Closed enumeration of audit_log action identifiers — single source of truth for both response bodies and query-parameter filters on the audit-trail read surface. Mirrors AUDIT_ACTIONS Adding a new value is a one-line append HERE that propagates via $ref to every consumer. Append-only — renaming a value is a /v2 break.

Schema mirrors production exactly ($ref AuditAction enum). Generated clients see the typed enum on both prod and sandbox surfaces. Sandbox runtime does NOT validate against the enum and does NOT filter the response — the full fixture is returned regardless.

initiated_by'human' | 'agent' | 'cron' | 'system' | 'unknown'

Closed enumeration of initiated_by classifier values — single source of truth for both response bodies and query-parameter filters on the audit-trail read surface. Mirrors INITIATED_BY_VALUEShuman = write action confirmed via the X-Approval-Token UI flow. agent = self-identifying AI client OR an unattended write without approval. cron = scheduled job hitting /api/cron/* with the configured CRON_SECRET. system = reserved for future internal service-to-service calls. unknown = read verbs without other signals, plus the historical-row backfill default for pre-correlation-id rows.

Schema mirrors production exactly ($ref AuditInitiatedBy enum). Generated clients see the typed enum on both prod and sandbox surfaces. Sandbox runtime does NOT validate against the enum and does NOT filter the response.

simulate_error'missing_delegation' | 'invalid_token' | 'validation_error' | 'scope_missing' | 'altinn_timeout' | 'invalid_certificate' | 'malformed_payload' | 'upstream_5xx' | 'AUTH_MISSING_DELEGATION' | 'AUTH_EXPIRED_TOKEN' | 'VALIDATION_FAILED' | 'SCOPE_MISSING'

Force the sandbox to return a structured error response. tokens (Apier-edge failures) — missing_delegation → 403 AUTH_MISSING_DELEGATION; invalid_token → 401 AUTH_EXPIRED_TOKEN; validation_error → 400 VALIDATION_FAILED; scope_missing → 403 SCOPE_MISSING. upstream-failure tokens — altinn_timeout → 504 EXECUTION_DEADLINE_EXCEEDED (Altinn 3 instances endpoint timed out, response body carries the Altinn RFC 7807 envelope); invalid_certificate → 502 MASKINPORTEN_AUTH_FAILED (Maskinporten OAuth2 error_object — invalid_client); malformed_payload → 422 GOVERNMENT_VALIDATION_REJECTED (Skatteetaten validation errors with nested path[] arrays); upstream_5xx → 502 GOVERNMENT_UNAVAILABLE (generic government 5xx). The 500 INTERNAL_ERROR path is reserved for unexpected internal failures. Accepts BOTH lowercase public tokens (primary contract) AND uppercase internal explainer codes (back-compat). Wins precedence over reserved-org defaults.

Headers

X-Apier-Simulate'error_500' | 'timeout' | 'rate_limit'

Infrastructure-failure injection. Honored ONLY on the authenticated sandbox company READ routes AND only with the synthetic apier_sandbox_test_<suffix> bearer — a real ("live") key with this header present returns 403 SANDBOX_TEST_KEY_REQUIRED (explicit, never silent: a live key must never receive simulated data). error_500 -> 500, timeout -> 504 after a fixed capped delay, rate_limit -> 429 + Retry-After: 30. Every simulated response carries _meta.simulated: true, burns no real rate-limit quota, and fires no Sentry alert. Case-sensitive; any other value -> 422 VALIDATION_FAILED. Distinct from ?simulate_error= (domain / upstream error SHAPES) — this simulates transport / infrastructure faults so an agent can rehearse its own retry / backoff / timeout handling.

Response

Sandbox 2xx success for GET /api/v1/sandbox/company/{org}/audit. Body shape is the typed SandboxAuditEnvelope — { success: true, data: SandboxAuditData, _meta: SandboxMeta }. Note the double-wrapped data nesting (data.data for the rows + data.pagination for the cursor block) which mirrors production audit's envelope.

successtrue required

Changes

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