Skip to main content

VerifyAPI developer docs

Verify AI outputs and retrieve proof records.

VerifyAPI accepts structured model output, evaluates it against named rules and supplied evidence, then returns a retrievable verification and proof record.

Authentication

Production verification requires an authenticated SwarmSync principal. Send JSON and one supported credential header:

Content-Type: application/json
Authorization: Bearer <jwt_access_token>

# Agent/service accounts can use any of:
Authorization: Bearer <service_account_api_key>
Authorization: ApiKey <service_account_api_key>
x-api-key: <service_account_api_key>
x-agent-api-key: <agent_api_key>

Create and rotate keys from the console. Keep production calls on POST /api/verify.

Minimal authenticated request

POST /api/verify
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "source_type": "api_output",
  "task": "invoice_extraction",
  "output": {
    "vendor_name": "Acme Cloud Services",
    "amount_total": 8450,
    "invoice_number": "INV-10492"
  },
  "rules": [
    "vendor_name_present",
    "amount_total_present",
    "missing_po_check"
  ],
  "evidence": [
    { "expected_total": 8450 }
  ]
}

For no-key demos, use POST /api/verify/demo as the sandbox endpoint.

Endpoints

Verification and proof API surface

Store the returned verification_id and proof_id. They are the lookup keys for history, proof retrieval, chain checks, and exports.

POST
/api/verify

Submit model output, rules, and optional evidence. Returns a verification ID, proof ID, status, confidence, risk level, issues, and proof metadata.

Required
POST
/api/verify/demo

Runs the same verification shape for demos and product trials without requiring credentials. Use it for examples, not production traffic.

Public sandbox
GET
/api/verify/:id

Fetch a saved verification run with status, risk level, confidence, issues, checks performed, and timestamps. Authenticated production records are scoped to the caller organization; sandbox records are retrievable as anonymous demo records.

Scoped lookup
GET
/api/proof/:id

Fetch the proof record for a verification, including evidence, timeline, final decision, proof metadata, and linked verification summary. Production records are scoped to the caller organization.

Scoped lookup
GET
/api/proof/:id/verify

Recomputes this one proof record's own hash and checks an optional signature. This is a fast single-record check only — it confirms the record itself was not altered after creation, but does not confirm its place in the wider chain is unbroken. Use GET /api/proof/chain/verify for that.

Public (single-record spot-check)
GET
/api/proof/chain/verify

Walks your organization's full proof chain back to genesis (or from an optional startProofId), independently re-checking every record against the actual current hash of the record before it. Reports the first tampering break found, if any — this is the check that certifies chain-wide integrity, not the single-record /verify endpoint above.

Required
GET
/api/proof/:id/export/pdf

Download a PDF proof report for auditors, customers, or internal records in the caller organization or anonymous sandbox scope.

Scoped lookup
GET
/api/proof/:id/export/json

Download the full proof record as structured JSON for archives and downstream systems in the caller organization or anonymous sandbox scope.

Scoped lookup