Skip to content
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",
  "publicKeyPem": "string",
  "signedField": "digest"
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "document": {
          "type": "object",
          "additionalProperties": {},
          "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": {
          "default": "snapshotHash",
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "description": "Field in the document that holds the hash. Strip-before-recompute target. Use 'bundleHash' for audit bundles, 'payload_hash' for evidence rows."
        },
        "publicKeyPem": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "signedField": {
          "default": "digest",
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "required": [
        "document",
        "claimedHash",
        "hashField",
        "signedField"
      ],
      "additionalProperties": false
    }
  }
}

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", "publicKeyPem": "string", "signedField": "digest" }'

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",
    "publicKeyPem": "string",
    "signedField": "digest"
  },
});
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",
    "publicKeyPem": "string",
    "signedField": "digest"
},
)
print(response)

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{"document":{},"claimedHash":"<The hash claimed in the document or the >","hashField":"snapshotHash","publicKeyPem":"string","signedField":"digest"}`)
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/compliance/verify", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400

Other Compliance endpoints