Skip to main content

API Reference

Base URL: https://api.courtrules.app

Endpoints

MethodPathDescription
GET/api/v1/courtsList all federal district courts
GET/api/v1/courts/:idGet a single court’s details
GET/api/v1/judgesList judges for a district
GET/api/v1/rulesGet applicable rules for a judge
POST/api/v1/checkCheck document compliance
POST/api/v1/classifyLLM-powered document classification
GET/api/v1/openapi.yamlDownload the OpenAPI specification

Authentication

All endpoints require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
See Authentication for details on obtaining and using API keys.

OpenAPI specification

The complete OpenAPI 3.1 spec is available for download:
curl 'https://api.courtrules.app/api/v1/openapi.yaml' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o openapi.yaml
Use this with Postman, code generators, or AI agents. See Building with AI Agents for integration examples.

Content type

All POST requests must use Content-Type: application/json. All responses are application/json.

Error responses

Error responses follow a consistent format:
{
  "error": "Human-readable error message"
}
Validation errors include details:
{
  "error": "Invalid request",
  "details": [{ "path": "document.page_count", "message": "Required" }]
}

HTTP status codes

CodeMeaning
200Success
400Invalid request (missing params, validation failure)
401Missing or invalid Authorization header
403Invalid API key, or district not yet accessible
404Resource not found (judge not in district, unknown district ID)
502Upstream failure (LLM error on /classify)