---
title: "Sandbox mirror of /api/v1/company/{org}/audit (API key or sandbox bearer)"
method: GET
path: "/api/v1/sandbox/company/{org}/audit"
tags: ["Sandbox"]
---

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

`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

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.

## Query parameters

- `limit` integer
- `cursor` string
- `before` string, date-time
- `before_id` string, uuid
- `since` string, date-time
- `until` string, date-time
- `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.
- `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.
- `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'

## Headers

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

## Response `200`

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.

- SandboxAuditEnvelope: Sandbox 2xx success envelope BASE shape. Top-level keys mirror the production envelope (`success`, `_meta`) so SDK clients consuming sandbox responses see identical shapes. The `data` field is intentionally omitted from the base — per-operation envelopes (`SandboxContextEnvelope`, `SandboxObligationsEnvelope`, ...) `allOf` this base and pin `data` to the operation's typed payload, so generated clients keep the mirror typing for each route.
  - `success` true, required
  - `_meta` SandboxMeta, required: Sandbox `_meta` block. NOT a drop-in for production's `TrustMetadata`; clients must branch on `is_sandbox` before assuming any sandbox/production field equivalence. Differences from production: 1. `is_sandbox: true` — load-bearing detection signal; `body._meta.is_sandbox === true` is a single property assertion agents use to verify they're talking to the sandbox. Production omits this key entirely. 2. `rulebook_version` is the literal string `"sandbox"` — production carries the actual Rulebook version (e.g. `"v1.0.0"`). Sandbox responses are not Rulebook-evaluated. 3. `data_freshness` and `last_verified` are pinned constants (2026-01-01T00:00:00+01:00) — production reflects actual cache / fetch state. 4. `response_timestamp` is RFC 3339 with explicit Europe/Oslo offset (`+01:00` CET / `+02:00` CEST, DST-aware) — production's `response_timestamp` carries a UTC `Z` suffix. 5. `response_hash` and `source_snapshot_id` are OMITTED — sandbox writes ZERO provenance_log rows, so a hash without a matching forensic row would be misleading. Only `source` (`"apier.no"`) and `schema_version` semantics are shared with production.
    - `rulebook_version` 'sandbox', required: Always literal `sandbox` — sandbox responses are not Rulebook-evaluated.
    - `data_freshness` '2026-01-01T00:00:00+01:00', date-time, required: Pinned constant (2026-01-01T00:00:00+01:00) for determinism — same value on every call. Schema-locked via `enum` so spec-based drift checks catch any deviation.
    - `last_verified` '2026-01-01T00:00:00+01:00', date-time, required: Pinned constant — equal to data_freshness. Schema-locked via `enum` for the same drift-detection reason.
    - `source` 'apier.no', required: Response origin. Always `apier.no`. Preserves `_meta.source` parity with production `TrustMetadata.source` so clients can reuse `_meta` parsing across both surfaces. Provenance-specific fields (`response_hash`, `source_snapshot_id`) are omitted by design.
    - `schema_version` string, required: OpenAPI document version — mirrors the top-level `info.version` field. Distinct from `/api/v1/capabilities._meta.schema_version` and `/workflows.json.schema_version`, which version the capabilities-discovery and workflows-discovery surfaces respectively. Equality with `info.version` is enforced at CI time.
    - `is_sandbox` true, required: Load-bearing sandbox-detection signal. Always `true`.
    - `response_timestamp` string, date-time, required: RFC 3339 timestamp with explicit Europe/Oslo offset — runtime emits via `formatInTimeZone(now, 'Europe/Oslo', "yyyy-MM-dd'T'HH:mm:ssXXX")` so the offset is DST-aware (`+01:00` in CET / `+02:00` in CEST). The ONLY non-deterministic field permitted on sandbox responses (excluded from determinism comparisons).
    - `sandbox_notice` string, required: Human-readable mock-vs-government honesty signal (item 5). Constant prose: a passing sandbox run is an Apier internal mock (not Altinn TT02 / Skatteetaten test) and does not guarantee real government acceptance. `is_sandbox` is the machine-readable twin; this is the prose an agent or a human reading a logged response sees. Plain ASCII so it never trips the docs bokmål canary.
    - `cost_nok` 0: Always `0`. A sandbox call never debits anything — there is no ledger write and no government upstream. Same field name and rendering as production's `TrustMetadata.cost_nok`, so a client that reads the cost off `_meta` works unchanged against both surfaces. Emitted on every sandbox response. Declared optional in this schema only so the many older sandbox examples in this document stay valid; the runtime builder emits it on every response.
    - `wallet_remaining_nok` unknown
    - `as_of` string: Present ONLY when `?as_of=` Rulebook time travel is active on /deadlines or /obligations. Echoes the agent's exact YYYY-MM-DD input so a transcript is self-describing about which reference date the deadline / obligation statuses were derived against. Absent on every other sandbox response.
    - `simulated` true: Present + `true` ONLY on an `X-Apier-Simulate` injected failure response. The load-bearing signal that a 500 / 504 / 429 is a deliberately-simulated infrastructure failure, not a real one. Absent on every real sandbox response.
    - `session_merged` true: Present + `true` ONLY when this response merged per-suffix session state (mock filings recorded by a prior POST /api/v1/sandbox/actions/execute under the SAME sandbox-bearer suffix) over the static fixture, on the three opted-in reads (/audit, /obligations, /summary). The honesty marker distinguishing fixture state from session state. Absent on every fresh-suffix response, which stays byte-deterministic.
    - `session_merged_rows` integer: Count of response items the merged session state changed (obligation/deadline statuses overridden plus audit rows prepended). Present ONLY alongside `session_merged: true`, always >= 1.
  - `data` SandboxAuditData, required: Top-level data shape returned by GET /api/v1/sandbox/company/{org}/audit. Note the double-wrap (`data.data` for the rows + `data.pagination` for the cursor block) — production audit uses the same nesting.
    - `data` SandboxAuditEntry[], required
      - `id` string, uuid, required
      - `timestamp` string, date-time, required
      - `org_number` string, required
      - `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', required: 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.
      - `initiated_by` 'human' | 'agent' | 'cron' | 'system' | 'unknown', required: 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.
      - `details` object, required
    - `pagination` object, required
      - `limit` integer, required: Echoed page-size cap. Always emits the production default (50) regardless of any `?limit=` value — sandbox does not paginate (deterministic-fixture model).
      - `has_more` false, required: Sandbox pagination is a stub — `has_more` is always false; the fixture's audit_entries array is returned in full. Agents testing pagination logic should hit production.

## Other responses

- `400`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `401`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `403`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `404`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `422`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `429`: 429 emitted ONLY by the X-Apier-Simulate: rate_limit failure injection on the authenticated sandbox company READ routes. Body is the standard SandboxEnvelopeError (error_code RATE_LIMIT_EXCEEDED); _meta.simulated:true marks it a deliberate injection, NOT a real per-key/per-org limiter block — the simulation gate short-circuits BEFORE the rate limiter so the real bucket is never consumed (zero quota burned). Distinct from SandboxError so the Retry-After contract (always 30s) is documented exactly where the simulated 429 appears.
- `500`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.
- `504`: Sandbox 4xx / 5xx error. Body shape mirrors the production error envelope (`{ success: false, error_code, explanation, _meta }`); `explanation` is the Compliance Explainer's full Norwegian-bokmål `{ summary, why, fix_steps[], relevant_link, legal_basis, handover }`. The Cache-Control header is `no-store` so transient failures aren't pinned in the Edge cache.

---

[API](https://skmtc.dev/apier/apis/apier-no-api.md) · [All operations](https://skmtc.dev/apier/apis/apier-no-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apier/apis/apier-no-api/revisions/9ec19bc87311?raw)
