/api/v1/compliance/verifyPublic 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: none. This is a public endpoint and no credential is read. The empty `security` is a deliberate statement rather than an omission — nothing on this path resolves a caller, so no API-key scope is evaluated and an `eg_` key sent anyway is ignored.
Authentication
Public endpoint. No credential is read — send the request without an Authorization header. This is a deliberate statement, not a missing one.
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
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
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
const res = await fetch("https://evalguard.ai/api/v1/compliance/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"document": {},
"claimedHash": "<The hash claimed in the document or the >",
"hashField": "snapshotHash",
"publicKeyPem": "string",
"signedField": "digest"
}),
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"
response = requests.request(
"POST",
"https://evalguard.ai/api/v1/compliance/verify",
headers=headers,
json={
"document": {},
"claimedHash": "<The hash claimed in the document or the >",
"hashField": "snapshotHash",
"publicKeyPem": "string",
"signedField": "digest"
},
)
print(response.status_code, response.json())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)
}