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

# Investigate a decision in the audit trail (API)

> Find a validation, read why Tracer decided, and verify that the audit trail is intact.

Find a validation, read why Tracer decided, and check that the audit trail is intact.

## Participants

***

* **Your institution.** Your system reads the decisions and their audit trail.
* **Tracer.** Keeps the validations and their audit events, and verifies the audit chain.

## Before you start

***

* Your system can call the Tracer API with a valid credential. See the [Tracer integration guide](https://docs.lerian.studio/en/products/tracer/integration-guide.md).
* The decision came from a validation request of your system. See [Validate a transaction before the ledger](https://docs.lerian.studio/en/diagrams/lerian-products/tracer-validate-before-ledger.md).

## Diagram

***

![Investigate a decision in the audit trail](https://mintcdn.com/lerian-49cb71fc/KypD0TIKUCqZ014J/images/en/d2/id-tracer-investigate-a-decision.svg?fit=max\&auto=format\&n=KypD0TIKUCqZ014J\&q=85\&s=71f6dd7759c153b5f4b90afe5b215a1f)

## Steps

***

| # | From | To | Message | Lerian API | What happens |
| - | - | - | - | - | - |
| 1 | Your institution | Tracer | Lerian API | [`GET /v1/validations`](https://docs.lerian.studio/en/reference/products/tracer/list-validations) | List the validations. Filter by `decision`, `account_id`, `matched_rule_id`, `exceeded_limit_id`, `scheme`, `start_date` and `end_date`. |
| 2 | Tracer | Your institution | Lerian API | Response to step 1 | Tracer returns the matching validations, newest first, with a cursor for the next page. |
| 3 | Your institution | Tracer | Lerian API | [`GET /v1/validations/{validation_id}`](https://docs.lerian.studio/en/reference/products/tracer/retrieve-validation) | Read one validation. |
| 4 | Tracer | Your institution | Lerian API | Response to step 3 | Tracer returns the transaction context you sent, the decision, the matched rules and the limit usage. |
| 5 | Your institution | Tracer | Lerian API | [`GET /v1/audit-events`](https://docs.lerian.studio/en/reference/products/tracer/list-audit-events) | List the audit events of the validation. Set `resource_id` to the `validationId`. |
| 6 | Tracer | Your institution | Lerian API | Response to step 5 | Tracer returns the audit events. |
| 7 | Your institution | Tracer | Lerian API | [`GET /v1/audit-events/{audit_event_id}/verify`](https://docs.lerian.studio/en/reference/products/tracer/verify-audit-event) | Verify the audit chain up to the event. |
| 8 | Tracer | Your institution | Lerian API | Response to step 7 | Tracer returns `isValid`, the number of events it checked and, when the chain fails, `firstInvalidId`. |

## How you know it finished

***

The verification returns `isValid` as `true` for the chain up to the event.

## Rules

***

* The audit event of a validation has the type `TRANSACTION_VALIDATED`.
* Without `start_date` and `end_date`, both lists cover the last 90 days.
* The API has no route to change or delete a validation or an audit event.
* The reservations for Midaz transactions appear as audit events with the resource type `reservation`. They are not validations.

## What can go wrong

***

| Situation | What you see | What to do |
| - | - | - |
| The validation is older than the default window. | An empty list. | Widen `start_date` and `end_date`. |
| The audit chain fails the check. | `isValid` is `false`. | Send the response to Lerian support. |

## Related

***

* [Validate a transaction before the ledger](https://docs.lerian.studio/en/diagrams/lerian-products/tracer-validate-before-ledger.md)
* [Audit and compliance](https://docs.lerian.studio/en/products/tracer/audit-compliance.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.