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

# Query audit logs and verify hash chain integrity

> Query immutable audit log entries by event type, user, or date range. Verify the full hash chain integrity before submitting compliance evidence to regulators.

Every action processed by Centsless — transactions, overrides, voids, tip operations, and administrative changes — produces an audit log entry with a cryptographic SHA-256 hash. Each entry's hash incorporates the previous entry's hash, forming a linked chain. Any attempt to modify, delete, or reorder historical records breaks the chain and is immediately detectable. Use these endpoints to query log entries and verify chain integrity before regulatory submissions.

## Authentication

All requests require an `x-api-key` header with auditor or admin scope.

***

## GET /admin/audit-logs — Query audit logs

Retrieve audit log entries with optional filtering by event type, user, and date range.

```
GET https://api.centsless.org/api/v1/admin/audit-logs
```

### Query parameters

<ParamField query="limit" type="integer">
  Maximum number of entries to return. Defaults to `100`.
</ParamField>

<ParamField query="event_type" type="string">
  Filter by event type. Examples: `transaction`, `override`, `void`, `tip_payout`
</ParamField>

<ParamField query="user_id" type="string">
  Filter entries to those associated with a specific user or employee ID.
</ParamField>

<ParamField query="start_date" type="string">
  Start of the date range in ISO 8601 datetime format. Example: `2026-01-01T00:00:00Z`
</ParamField>

<ParamField query="end_date" type="string">
  End of the date range in ISO 8601 datetime format. Example: `2026-03-31T23:59:59Z`
</ParamField>

### Code example

```bash theme={null}
curl "https://api.centsless.org/api/v1/admin/audit-logs?limit=50&event_type=override&start_date=2026-01-01T00:00:00Z" \
  -H "x-api-key: YOUR_API_KEY"
```

Each entry in the response includes the event details and a cryptographic hash that links it to its position in the chain.

***

## GET /admin/verify-hash-chain — Verify hash chain integrity

Run a full integrity check across the entire transaction hash chain. The engine walks the chain from genesis and verifies that each entry's hash correctly incorporates the previous entry's hash.

```
GET https://api.centsless.org/api/v1/admin/verify-hash-chain
```

### Code example

```bash theme={null}
curl https://api.centsless.org/api/v1/admin/verify-hash-chain \
  -H "x-api-key: YOUR_API_KEY"
```

### Response

```json theme={null}
{
  "total_count": 14823,
  "verified_count": 14823,
  "break_count": 0,
  "breaks": []
}
```

<ResponseField name="total_count" type="integer">
  Total number of entries in the hash chain.
</ResponseField>

<ResponseField name="verified_count" type="integer">
  Number of entries whose hashes were successfully verified.
</ResponseField>

<ResponseField name="break_count" type="integer">
  Number of breaks detected in the chain. Any value above `0` indicates potential tampering.
</ResponseField>

<ResponseField name="breaks" type="array">
  Details of each break found, including the position in the chain and the affected entry IDs.
</ResponseField>

<Note>
  Run hash chain verification before submitting compliance reports to regulators. A verified result with `break_count: 0` provides tamper-proof evidence that your transaction records have not been altered since they were written.
</Note>
