prooftrail

Universal API Reference

This page is the public API reference landing page for ProofTrail.

It does not try to restate every schema inline. Its job is simpler: explain which API families exist, what lane they belong to, and where to look next when you need the exact contract.

Builder Start Here

If you are integrating ProofTrail from another tool, start with this order:

  1. read this page for lane boundaries
  2. read API builder quickstart for runnable examples
  3. inspect contracts/openapi/api.yaml for the exact schema contract
  4. verify the generated web client is current:
node --import tsx contracts/scripts/generate-client.ts --verify
  1. choose one of the two public integration roads:
    • API when you want direct contract-level integration
    • MCP when you want a governed tool surface for an external AI client

Think of it like plumbing versus appliances:

You should not treat those as interchangeable.

If your real question is:

the truthful answer is: use this API layer when you want direct contract-level control and keep the coding agent outside ProofTrail.

If you reached this page from a Codex, Claude Code, OpenHands, OpenCode, or OpenClaw workflow, the same rule still applies:

ProofTrail is the browser-evidence contract layer in that setup, not the vendor-specific shell.

For the shortest repo-native contract check, run:

pnpm test:contract

That command validates the checked-in contract tests and the generated-client freshness gate together. Add pnpm contracts:check-openapi-coverage when you want the broader endpoint coverage check as well.

Category Fit

ProofTrail’s API is part of an evidence-first browser automation platform with recovery and MCP.

That means the API should be read through the same lane model as the product:

Do not collapse those records into one object model just because they can all appear in the same user story.

OpenAPI Contract

Useful Endpoint Families

First Builder Calls

If you want the shortest path to prove you are talking to the right backend, use these calls first:

curl http://127.0.0.1:17380/health/diagnostics
curl http://127.0.0.1:17380/api/evidence-runs/latest
curl http://127.0.0.1:17380/api/automation/commands

What each one tells you:

TypeScript Client Path

If you are integrating from TypeScript, the repo already checks in generated web client artifacts under:

The freshness gate is the generator itself:

node --import tsx contracts/scripts/generate-client.ts --verify

When that passes, the generated client is aligned with the checked-in OpenAPI contract.

Treat that client as a repo-local helper surface, not as a published SDK.

API vs MCP

Use API when:

Use MCP when:

For Codex-, Claude Code-, OpenHands-, OpenCode-, OpenClaw-, and other AI-agent-shell workflows, the decision rule stays the same:

The API is the contract layer.

The MCP server is the governed tool layer built on top of that contract.

For named agent ecosystems, the split is simplest when you read it like this:

For the dedicated search-intent landing page, see ProofTrail for Coding Agents and Agent Ecosystems.

Reading Order

If you are new to the product, do not start from raw endpoint enumeration.

Use this order instead:

  1. README.md
  2. docs/architecture.md
  3. docs/reference/run-evidence-example.md
  4. contracts/openapi/api.yaml
  5. node --import tsx contracts/scripts/generate-client.ts --verify
  6. apps/mcp-server/README.md

That order helps you understand what the API is for before you study the exact shapes.