> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit trail

# Audit Trail + Compliance

Better Data stores loop transition history as first-class operational data. Compliance export is generated from the same transition records used to run the system.

## How The Audit Trail Works

Every transition stores:

* Actor identity (`actorId`)
* Transition timestamp (`occurredAt`, UTC)
* Triggering event name (`triggeredBy`)
* Correlation trace (`correlationId`)
* Causation trace (`eventId` and event chain context)

## Exporting The Audit Trail

`GET /api/organizations/{orgId}/audit-trail`

<ParamField path="loopId" type="string">
  Optional loop filter such as `scm.procurement` or `dcm.returns`.
</ParamField>

<ParamField path="aggregateId" type="string">
  Optional aggregate filter (PO, order, RMA, shipment, lot).
</ParamField>

<ParamField path="from" type="string">
  Optional ISO-8601 lower bound for transition timestamps.
</ParamField>

<ParamField path="to" type="string">
  Optional ISO-8601 upper bound for transition timestamps.
</ParamField>

<ParamField path="format" type="string">
  `json` (default) or `csv`.
</ParamField>

```bash theme={null}
curl -H "x-api-key: <your-key>" \
  "https://api.betterdata.co/api/organizations/org_lumebonde_demo/audit-trail?loopId=scm.procurement&format=csv"
```

## Regulatory Alignment

<CardGroup cols={2}>
  <Card title="DSCSA">
    Transition-linked chain-of-custody signals support transaction traceability expectations.
  </Card>

  <Card title="FSMA">
    Goods receipt and movement transitions support CTE/KDE style trace evidence.
  </Card>

  <Card title="FDA 21 CFR Part 11">
    Actor-attributed transitions provide auditable electronic action history.
  </Card>

  <Card title="EU CSRD / Due Diligence">
    Correlated actor and event chains provide defensible supply chain evidence.
  </Card>
</CardGroup>

<Warning>
  Regulatory references are informational and do not replace legal/compliance review for your jurisdiction and use case.
</Warning>

## Signal Tags

Signal Tags add product-level provenance semantics that complement loop-level audit records.

See <a href="/oss/signal-tags">Signal Tags documentation</a>.
