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

# Verify Audit Log Integrity

Recomputes the organization's hash chain and tells you whether any entry was altered, removed or inserted after the fact. Every entry is sealed with a hash that includes the previous entry's hash, so changing history breaks the chain from that point on. See [how it works](https://docs.timbrix.mx/audit-log.md#integridad-verificada).

## Authentication

Accepts **either**:

* An API key (`X-API-Key: sk_...`) with the `read:audit-logs` scope.
* A Supabase Bearer session (`Authorization: Bearer <token>`) with the `X-Organization-Id: <org-id>` header — the user must be an owner or admin of that organization.

## Rate limit

Verifying recomputes the whole chain, so this endpoint is limited to **10 requests per minute**, on top of your plan's limit. Beyond that it returns `429 Too Many Requests`.

## Example Request

```bash theme={null}
curl "https://api.timbrix.mx/audit-logs/verify" \
  -H "X-API-Key: sk_..."
```

```typescript theme={null}
const result = await client.auditLogs.verify(
  "550e8400-e29b-41d4-a716-446655440000"
)
if (!result.valid) {
  console.error(`The log was altered at entry ${result.firstBrokenSeq}`)
}
```

## Example Response

```json theme={null}
{
  "valid": true,
  "checkedEntries": 1280,
  "firstBrokenSeq": null
}
```

| Field | Description |
| - | - |
| `valid` | `true` when every entry matches its hash and the chain has no gaps |
| `checkedEntries` | How many entries were checked |
| `firstBrokenSeq` | The `seq` of the first altered, removed or inserted entry. `null` when `valid` is `true` |

## Common Errors

### 403 Forbidden

Not an owner or admin, or the API key lacks the `read:audit-logs` scope.


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