Endpoints
All examples assume BASE=http://localhost:5001 and the audit domain.
Create a record
Section titled “Create a record”POST /api/v1/{domain}/recordscurl -s -X POST $BASE/api/v1/audit/records -H 'Content-Type: application/json' -d '{ "source": "crm", "payload": { "party": "acme", "amount": 100 }, "hash_fields": ["party", "amount"]}'{ "status": "success", "message": "Record created successfully", "data": { "domain": "audit", "id": "22723eb2-…", "hash": "32818c68…" } }hash_fields is optional — when present, only those payload keys feed the hash.
List records
Section titled “List records”GET /api/v1/{domain}/records?limit=25&source=crm{ "records": [ { "tenant": "default", "domain": "audit", "id": "58df…", "source": "crm", "payload": { "amount": 75, "party": "initech" }, "hash": "9cbd…", "hash_version": 2, "created_at": "2026-06-22T22:51:05Z" }] }Get / delete a record
Section titled “Get / delete a record”GET /api/v1/{domain}/records/{id}DELETE /api/v1/{domain}/records/{id} # soft-delete; audit trail preservedAnchor a batch
Section titled “Anchor a batch”POST /api/v1/{domain}/records/batch{ "batch_id": "default-audit-3290b38d", "tenant": "default", "domain": "audit", "merkle_root": "20e1a987…", "num_records": 3, "tx_id": "1d96e697…", "anchored": true, "channel": "logchannel" }Verify a batch
Section titled “Verify a batch”POST /api/v1/{domain}/records/verify/{batchId}{ "batch_id": "default-audit-3290b38d", "is_valid": true, "num_logs": 3, "original_merkle_root": "20e1a987…", "recalculated_merkle_root": "20e1a987…", "on_chain_merkle_root": "20e1a987…", "anchor_status": "ANCHORED", "integrity": "VALID", "message": "Batch integrity verified against the on-chain anchor" }integrity is VALID or CORRUPTED. A corrupted batch (any record altered)
returns is_valid: false — it does not error.
Audit report
Section titled “Audit report”GET /api/v1/{domain}/report # JSONGET /api/v1/{domain}/report.pdf # PDF download{ "tenant": "default", "domain": "audit", "generated_at": "2026-06-22T22:51:06Z", "batches": [ { "batch_id": "default-audit-3290b38d", "merkle_root": "20e1a987…", "tx_id": "1d96e697…", "num_records": 3, "batched_at": "2026-06-22T22:51:05Z" } ], "total_batches": 1, "total_records": 3 }Health
Section titled “Health”GET /health{ "status": "healthy", "services": { "mongodb": "healthy", "redis": "healthy", "fabric": "healthy", "batch_processor": "running" } }Public anchor proof
Section titled “Public anchor proof”Unauthenticated. Returns only “anchored: yes/no + timestamp + root” — never tenant
metadata. Optionally pass ?root= to check a root you hold.
GET /public/anchors/{batchId}{ "anchored": true, "anchored_at": "2026-06-22T22:51:05Z", "batch_id": "default-audit-3290b38d", "merkle_root": "20e1a987…" }A batch that isn’t anchored returns 404. See verifying integrity.