Built for Fly.io Hacksgiving 2026. See how each judge's product is used
Skip to Content
ReferenceHTTP API

HTTP API

The Courthouse's JSON API. Every read is public; every write except asking an ancestor needs the admin token.

2 min readUpdated

In shortFor anyone building on the live family, or reading it from a script

One origin serves the API and the live site. Pick a route in the sidebar for its parameters, response schema, a real example response from a simulated family, code samples, and a playground that sends the request for you.

Basics

Base URL
The Courthouse's Sprite URL, e.g. https://probate-courthouse-….sprites.app. Locally, http://localhost:8080 (make api or make dev).
Format
JSON in and out. Errors are {"detail": "…"} with a 4xx status.
Auth
None for reads and for asking an ancestor. Admin routes need the X-Probate-Admin header set to PROBATE_ADMIN_TOKEN. The judge mailroom needs the shared X-Probate-Key judge key, which no admin route accepts.
CORS
Only GET /api/summary may be read from other origins, so the landing page can show who is alive.
Rate limits
Asking an ancestor: 10 questions a minute per visitor, then 429.
Mode
/healthz and /api/summary say live or simulation. Simulated data is labelled wherever it's shown.

Routes

Examples

curl -s "$COURTHOUSE/api/summary" | jq '{mode, living: .living.name, counts}'
curl -s "$COURTHOUSE/api/trials/latest" | jq '.cases[] | {text, verdict, reason}'

The schema these pages are built from is apps/site/openapi.json, exported from the FastAPI app by make api-spec. Its examples come from a real simulated family, not from hand-written samples.

Edit on GitHub

Last updated on

On this page