Export and Verify the Per-Call Audit Trail

Use the per-call audit trail to review verification decisions for your app's agent connections. It is separate from the consent ledger: audit rows describe verified calls; the consent ledger records consent decisions and grant lifecycle events.

The export is a historical record, not a credential or permission another service can use to authorize a new action.

Export JSON or CSV

In the dashboard, open Logs and choose Export CSV. From your backend, call:

curl --fail-with-body --silent --show-error \
  'https://agentadmit.com/api/v1/audit/export?environment=live&format=json&limit=1000' \
  -H "Authorization: Bearer $AGENTADMIT_API_KEY" \
  -o audit-export.json

Use your app's API key, never an agent access token. The endpoint also accepts the developer's signed-in dashboard session; that form requires app_id. API keys are restricted to their linked app. Test keys must explicitly request environment=test and cannot read live or all-environment exports.

ParameterMeaning
environmentlive (default), test, or all. Legacy rows with no environment appear only under all.
formatjson (default) or csv.
app_user_id, connection_idOptional filters for a user or connection.
from, toOptional inclusive timestamp bounds; use ISO timestamps.
limitRows per page, default 1,000, maximum 10,000.
cursorOpaque continuation cursor from the preceding page.

JSON returns app_id, rows, count, next_cursor, and the reference verifier path. Continue with the same filters and cursor=next_cursor until it is null. CSV exposes the continuation in the X-Next-Cursor header. Preserve row order when combining pages. A single downloaded page is not necessarily the full trail.

Rows include connection and user identifiers, declared scope and endpoint/method, agent label, purpose, user intent, status, token jti, grant-event reference, metadata, environment, database timestamp, and the chain fields. Undeclared context can be null; the export does not infer what an app failed to declare.

Verify the chain

The reference verifier accepts a JSON export object or a JSON array of rows:

python3 scripts/verify_audit_chain.py audit-export.json

Each chain is scoped to an app and environment. The verifier checks the hash of chain_input, increasing sequence order, and links between successive row hashes. For continuity checks, export the full app/environment segment for your time window, without connection_id or app_user_id filters. Those filters intentionally omit interleaved rows and can therefore produce apparent chain gaps.

The first exported row may point to history before your selected window or retention boundary. The verifier reports this as an anchored start, not a failure. Pre-chain legacy rows are reported as unchained. Keep exports outside the operational database so later comparisons have an independent reference.

Tamper-evident, not tamper-proof. A self-consistent export alone cannot prove completeness or rule out an operator rewriting and re-chaining history. Compare retained exports or independently held anchors. A chain-valid result is also not proof that an action was appropriate, that the user read a screen, or that the app executed the action successfully.

Retention and consent evidence

Per-call audit rows expire under the audit retention policy (180 days by default). Consent-ledger retention is separate: use GET /api/v1/consent/export for consent events. Consult the App Owner Guide for consent evidence and the Protective Boundaries guide for protection changes.