Audit Trails for Embedded Accounting: Who Changed the Books, and Through Which App

What an embedded accounting audit trail must record, and the activity, ledger and posting-audit queries that answer each question in Paprel.

Paprel Engineering Team
9 min read
Attributed record cards sit along a copper audit timeline beneath an inspection lens

When a balance looks wrong, the question is always the same: who or what changed it, when, and through which integration? Here's what an embedded accounting audit trail must record, and the API calls that answer each question in Paprel.

In an embedded product, "who" is rarely just a person. It can be an operator in your admin console, a customer's bookkeeper, your backend's App Connect client, a partner app the company installed, or an AI agent working through MCP. An audit trail that records only a user ID can't tell those apart. This post covers the two layers that do: the activity history (who did what) and the ledger's own structure (what the books said, and what changed them).

Calls send authorization: Bearer <token> and x-partner-domain (Authentication and tokens). Schemas are in the API reference.

What an Embedded Audit Trail Must Answer

QuestionWhere Paprel answers it
Who or what acted?user_id and actor_source on each activity entry
Through which integration?actor_source.source_type, app_type, app_connect_id
What happened to this one record?GET /v1/activity/entity
What did the record look like before?Document versions under one anchor_id
What did the books actually post?GET /v1/accounting/journals/for-entity
Did every document post what it should have?GET /v1/reports/source-posting-audit

Who Changed It, and Through Which App

GET /v1/activity is the company-wide activity feed. It requires the activity:list permission (or role:admin). Give it to the people and apps that investigate, not to every integration.

To see everything one App Connect client did to one record in a time window:

Shell
curl -G "$BASE/v1/activity" -H "$AUTH" -H "$PARTNER" \
  --data-urlencode "entity_id=<record id>" \
  --data-urlencode "source_type=app_connect" \
  --data-urlencode "app_connect_id=<app connect client id>" \
  --data-urlencode "from=2026-10-01T00:00:00Z" \
  --data-urlencode "to=2026-11-01T00:00:00Z" \
  --data-urlencode "limit=100"

The filters that matter for embedded platforms:

  • source_type is the actor's source, for example app_connect for changes made through an App Connect client.
  • app_connect_id narrows to one client. It requires source_type=app_connect.
  • app_type narrows by application type, for example mcp_agent. It also requires source_type. This is how you answer "what did the agents do this week?"
  • from / to are RFC 3339 timestamps (inclusive / exclusive).
  • event filters on an exact event key. user_id and module narrow further.

These filters use cursor paging. Pass the returned next_cursor as cursor and keep every other filter unchanged. page, page_size and created_date belong to page mode, which can't be combined with the cursor filters.

Each entry carries the actor's identity:

JSON
{
  "id": "…",
  "user_id": "…",
  "entity_id": "<record id>",
  "acl_module_id": "…",
  "activity": "…",
  "message_key": "…",
  "message_params": {},
  "created_at": "2026-10-14T09:12:44Z",
  "actor_source": {
    "source_type": "app_connect",
    "app_type": "mcp_agent",
    "app_connect_id": "<app connect client id>",
    "source_label": "…"
  }
}

Note what this records: which app connection acted, not which scopes it held at the time. To audit what an app was allowed to do, pair the activity feed with your own record of the permissions you granted each App Connect client. Then give each integration its own client so app_connect_id stays meaningful. One shared client for everything turns "which integration?" back into guesswork.

One Record's History

For the timeline of a single invoice, bill or journal, use GET /v1/activity/entity. It takes entity_id and module, both required:

Shell
curl -G "$BASE/v1/activity/entity" -H "$AUTH" -H "$PARTNER" \
  --data-urlencode "entity_id=<record id>" \
  --data-urlencode "module=<module id from the activity list>"

Use it to build a document's activity panel: created, revised, status transitioned, sent, paid. Status changes in a configured approval workflow land here too, so "who approved this bill, and when?" is one read.

What the Ledger Guarantees Underneath

Activity entries tell you who acted. The ledger's structure makes sure there is something trustworthy to point at. From Tenancy, Isolation, and the Ledger Core:

  • Journals are append-only. Posted journal lines are not edited in place. Corrections are new entries. PUT /v1/accounting/journals/{anchor_id} edits drafts in place but rejects operator edits to posted journals. It re-validates balance, stamps a transaction hash and enforces fiscal period locks.
  • Voids reverse, they don't erase. PUT /v1/accounting/journals/void marks entries inactive, reverses their financial impact and preserves the audit trail. Locked or reconciled entries come back as per-item errors instead of being voided.
  • Documents are versioned under anchor_id. Every edit to an invoice or bill creates a new version, and the anchor stays constant. The anchor is what you store and link to. The version history is what an auditor walks.
  • Status transitions are history. Every transition in a company's configured workflow is recorded in the same audit history as the postings.
  • Reports are derived live from the journal rows. There is no separate reporting copy to drift.

To see exactly what a document posted, read its journal with GET /v1/accounting/journals/for-entity?entity_id=…&entity_type=….

Did Everything Post That Should Have?

Activity tells you what happened. GET /v1/reports/source-posting-audit tells you what didn't. By default it returns sources (documents, payments or expenses) whose posting effects are missing, ambiguous or mismatched:

Shell
curl -G "$BASE/v1/reports/source-posting-audit" -H "$AUTH" -H "$PARTNER" \
  --data-urlencode "kind=payments" \
  --data-urlencode "date=2026-10-31" \
  --data-urlencode "limit=50"

Each entry carries the source's anchor_id, document_number, required_effects, a missing list (a payment can be missing payment, payment_fx or both) and the journals linked to it. Each journal comes with its journal_version and transaction_hash. Add include_complete=true to return completed sources with their journal evidence. That gives you a period-end proof that every invoice and payment reached the ledger, not just a list of exceptions. The endpoint requires report:trial-balance (or role:admin).

When it finds a gap, POST /v1/reports/source-posting-audit/preview shows the missing posting without writing it. POST /v1/reports/source-posting-audit/repair posts it after you've reviewed the preview. Both require accounting:journal-add.

Retention and Export

How long activity history is kept, and in what export format, depends on your agreement. Treat it as a contract question, not a default. The tenancy doc describes it as the applicable activity history plus agreed retention and export features. Ask for the retention period, the export format, and what happens to history when a company is offboarded. See Security for the current trust posture.

Questions to Ask Any Vendor

  1. Can I filter history by the integration that made a change, not just the user?
  2. Can I tell an AI agent's changes apart from my backend's?
  3. Can a posted journal be edited in place, or only corrected with a new entry?
  4. If I edit an invoice, can I still see the version that was sent?
  5. Can I prove that every document and payment for a period reached the ledger?
  6. What is the retention period for activity history, and can I export it?
See every audit query in the API reference →

See how audit fits the permission model on permissions and audit, or run a full vendor check with how to evaluate embedded accounting.

Posted by: Paprel Engineering Team · Engineering
Posted on: (Updated: October 29, 2026)
Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout