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
| Question | Where 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:
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_typeis the actor's source, for exampleapp_connectfor changes made through an App Connect client.app_connect_idnarrows to one client. It requiressource_type=app_connect.app_typenarrows by application type, for examplemcp_agent. It also requiressource_type. This is how you answer "what did the agents do this week?"from/toare RFC 3339 timestamps (inclusive / exclusive).eventfilters on an exact event key.user_idandmodulenarrow 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:
{
"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:
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/voidmarks 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:
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
- Can I filter history by the integration that made a change, not just the user?
- Can I tell an AI agent's changes apart from my backend's?
- Can a posted journal be edited in place, or only corrected with a new entry?
- If I edit an invoice, can I still see the version that was sent?
- Can I prove that every document and payment for a period reached the ledger?
- What is the retention period for activity history, and can I export it?
Read Next
- For the permission model that decides what each app can do, read OAuth Scopes and Permissions for Embedded Accounting Platforms.
- For tenant boundaries under the audit trail, read Multi-Tenant Accounting Systems.
- For giving agents scoped, auditable access, read the custom agent guide.
- For the reconciliation history auditors check next, read Bank Reconciliation for Embedded Accounting.
See how audit fits the permission model on permissions and audit, or run a full vendor check with how to evaluate embedded accounting.
