POST/api/v1/compliance/verify

Public hash verification for downloaded compliance docs

Auditors verify a downloaded Annex IV / SoA / audit-bundle / evidence-row document hasn't been tampered with by re-computing its canonical-JSON SHA-256 hash server-side and comparing to the claimed hash. Pure function — no auth, no storage, no logging. The hash field within the document is stripped before recomputing (otherwise hash would be recursive). Default hashField=snapshotHash; override for bundleHash / payload_hash.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.

Request body required

Example

{
  "document": {},
  "claimedHash": "<The hash claimed in the document or the >",
  "hashField": "snapshotHash"
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "required": [
        "document",
        "claimedHash"
      ],
      "properties": {
        "document": {
          "type": "object",
          "description": "The full document object as downloaded."
        },
        "claimedHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "description": "The hash claimed in the document or the X-Snapshot-Hash response header."
        },
        "hashField": {
          "type": "string",
          "default": "snapshotHash",
          "description": "Field in the document that holds the hash. Strip-before-recompute target. Use 'bundleHash' for audit bundles, 'payload_hash' for evidence rows."
        }
      }
    }
  }
}

Response

200 example

{
  "success": true
}

All status codes

200ok=true if claimed hash matches recomputed; false otherwise. Includes computedHash for the auditor to inspect.
400Invalid body or 64-char hash constraint failed.

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/compliance/verify \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "document": {}, "claimedHash": "<The hash claimed in the document or the >", "hashField": "snapshotHash" }'

TypeScript

import { EvalGuard } from "@evalguard/sdk";

const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });

const response = await client.request({
  method: "POST",
  path: "/api/v1/compliance/verify",
  body: {
    "document": {},
    "claimedHash": "<The hash claimed in the document or the >",
    "hashField": "snapshotHash"
  },
});
console.log(response);

Python

from evalguard import EvalGuard
import os

client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])

response = client.request(
    method="POST",
    path="/api/v1/compliance/verify",
    body={
    "document": {},
    "claimedHash": "<The hash claimed in the document or the >",
    "hashField": "snapshotHash"
},
)
print(response)

Go

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/evalguard/evalguard-go"
)

func main() {
	client := evalguard.NewClient(os.Getenv("EVALGUARD_API_KEY"))
	resp, err := client.Request(context.Background(), "POST", "/api/v1/compliance/verify", map[string]any{"document": map[string]any{}, "claimedHash": "<The hash claimed in the document or the >", "hashField": "snapshotHash"})
	if err != nil { panic(err) }
	fmt.Println(resp)
}

Errors

400

Other Compliance endpoints