> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Verify the audit log's integrity

GET https://api.jelliu.co/api/audit/verify-chain

Recomputes the workspace's tamper-evident hash chain and reports the first row that does not
match. Each audit row stores `row_hash`, a hash of its content and of the previous row's hash.
Changing, inserting or deleting a row in the middle breaks the chain from that point on.

Rows are walked oldest first (`created_at`, then `id`) inside the optional `[from, to]` window,
both ends inclusive. Without a window, the whole retained history is checked, which can take a few
seconds on large workspaces. Rows older than the hash chain (no `row_hash`) are skipped.

Redacted rows are accepted when their redaction attestation (`redaction_hmac`) is valid. That covers
GDPR erasure of `changes` and the 90-day IP/user-agent sweep. They are counted in `redactedRows`, so
a green result still tells you a redaction happened. `anchoredMidChain: true` is normal with a `from`
bound, or after retention deleted older rows: the first row links to one outside the window, and
that link was not checked.

The result is returned at the top level, not wrapped in `data`.

**Idempotency.** A read with no side effects. Safe to retry. The result only changes when new rows
are written or a redaction happens.

**Access**
- **Required scope:** `full`. Human users need the **owner** role; admins are refused.
- **Rate limit:** Audit — 20 requests/min per workspace, shared with the other audit routes, plus the general API limit (120–600/min by plan). See [Rate limits](/rate-limits).
- **Plan:** Available on every plan.


Reference: https://developer.jelliu.co/api-reference/audit/get-audit-verify-chain

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Query parameters

- `from` (datetime, optional) — Inclusive start of the window. ISO 8601 datetime in UTC with a `Z` suffix; an offset such as `-05:00` or a bare date answers `400`.
- `to` (datetime, optional) — Inclusive end of the window. ISO 8601 datetime in UTC with a `Z` suffix.

## Response

### 200

Verification result (not wrapped in `data`).

- `valid` (boolean, required) — `true` when every signed row in the window matches its hash and links to its predecessor.
- `totalChecked` (integer, required) — Rows examined in the window.
- `redactedRows` (integer, required) — Redacted rows in the window with a valid attestation (exact count).
- `redactedRowIds` (list of string, required) — Ids of the first redacted rows (truncated list; the count above is exact).
- `anchoredMidChain` (boolean, required) — The first signed row in the window links to a row outside it (normal with a bounded `from` or after retention); that link was not checked.
- `firstInvalidRow` (string, optional) — Id of the first broken row. Present only when `valid` is false. Inspect it with `GET /api/audit/{id}`.
- `reason` (enum, optional) — Why the first broken row failed. Present only when `valid` is false. `hash_mismatch`: the row's content was changed after it was written. `link_broken`: the row does not point at the previous row's hash (a row was inserted or deleted). `unattested_redaction`: the row is marked redacted but the redaction signature is missing or invalid.
  - Allowed values: `hash_mismatch`, `link_broken`, `unattested_redaction`

## Errors

### 400 Bad Request Error

`from` or `to` is not an ISO 8601 UTC datetime.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

The caller is not the workspace owner, or the API key lacks the `full` scope.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

Audit rate limit (20/min) or general API limit exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

### Intact, with one attested redaction

**Response**

```json
{
  "valid": true,
  "totalChecked": 1824,
  "redactedRows": 1,
  "redactedRowIds": [
    "7c1e3a5b-9d2f-4e6a-8b0c-4d6f8a0c2e1b"
  ],
  "anchoredMidChain": true
}
```

**SDK Code**

```python Intact, with one attested redaction
import requests

url = "https://api.jelliu.co/api/audit/verify-chain"

querystring = {"from":"2026-08-01T00:00:00Z","to":"2026-09-14T23:59:59Z"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Intact, with one attested redaction
const url = 'https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Intact, with one attested redaction
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Intact, with one attested redaction
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Intact, with one attested redaction
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Intact, with one attested redaction
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Intact, with one attested redaction
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Intact, with one attested redaction
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### A row was modified

**Response**

```json
{
  "valid": false,
  "totalChecked": 612,
  "redactedRows": 0,
  "redactedRowIds": [],
  "anchoredMidChain": false,
  "firstInvalidRow": "5b0f3c1e-8d2a-4b7e-9f61-2c4d8a9e7b10",
  "reason": "hash_mismatch"
}
```

**SDK Code**

```python A row was modified
import requests

url = "https://api.jelliu.co/api/audit/verify-chain"

querystring = {"from":"2026-08-01T00:00:00Z","to":"2026-09-14T23:59:59Z"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript A row was modified
const url = 'https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A row was modified
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A row was modified
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A row was modified
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A row was modified
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A row was modified
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A row was modified
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/audit/verify-chain?from=2026-08-01T00%3A00%3A00Z&to=2026-09-14T23%3A59%3A59Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```