prooftrail

API Builder Quickstart

This page is for builders who already understand the product story and now need the shortest truthful path into ProofTrail’s contract layer.

Use this page when you are:

It is also the right page when your search intent sounds like:

Choose API vs MCP First

Think of it like plumbing versus appliances:

For Codex- and Claude Code-style workflows, choose API when the coding agent should stay in charge of reasoning while ProofTrail supplies browser execution, retained evidence, and recovery semantics.

Builder Reading Order

  1. README.md
  2. Universal API Reference
  3. contracts/openapi/api.yaml
  4. apps/web/src/api-gen/client.ts
  5. ProofTrail MCP Server README

The generated client in apps/web/src/api-gen/ is a repo-local helper for this workspace. It is not a published SDK package.

First Three Calls

1. Check runtime diagnostics

curl http://127.0.0.1:17380/health/diagnostics

2. Check retained evidence state

curl http://127.0.0.1:17380/api/evidence-runs/latest

3. Check automation command catalog

curl http://127.0.0.1:17380/api/automation/commands

Those three calls tell you:

TypeScript Client Example

The generated client is already checked into the repo. Use it from a repo-local script or another package inside this workspace.

// Example: a repo-local script launched from the ProofTrail workspace root.
import {
  listAutomationCommands,
  listEvidenceRuns,
} from "./apps/web/src/api-gen/client";

const baseUrl = "http://127.0.0.1:17380";

const commands = await listAutomationCommands(baseUrl);
const evidenceRuns = await listEvidenceRuns(baseUrl, { limit: 5 });

Useful generated files:

Verify The Contract Surface

Before you trust the generated client, run the fastest repo-native contract gate first:

pnpm test:contract

That command already runs the checked-in contract tests plus generated-client freshness verification.

If you want the underlying verify command directly, use:

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

If that fails, regenerate:

pnpm contracts:generate

Minimum Builder Verification Pack

pnpm contracts:check-openapi-coverage
node --import tsx contracts/scripts/generate-client.ts --verify
bash scripts/docs-gate.sh

Next Stop