Skip to main content
Base URL: https://api.courtrules.app The REST API covers court rules (compliance checks, judge rules, document classification). Enforcement data is available through the MCP server at mcp.courtrules.app, which also exposes court rules tools.

Endpoints

MethodPathDescription
GET/api/v1/courtsList all 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
GET/api/v1/profileGet a judge’s full compliance profile
GET/api/v1/documentsList source documents for a judge
GET/api/v1/documents/{id}/pdfDownload a source document PDF
POST/api/v1/checkCheck document compliance
POST/api/v1/classifyClassify a PDF and extract metadata
GET/openapi.jsonDownload 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.

Interactive playground

Each endpoint page in this section includes a live request builder. Select an endpoint from the sidebar, fill in parameters, and send real requests against https://api.courtrules.app. You’ll need your API key from console.courtrules.app.

OpenAPI specification

The complete OpenAPI 3.1 spec is available as a public endpoint (no authentication required):
curl 'https://api.courtrules.app/openapi.json' -o openapi.json
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. Most responses are application/json. Document PDF endpoints (/documents/{id}/pdf) return application/pdf.

Error responses

Error responses follow a consistent format with actionable guidance:
{
  "error": "Judge \"john-doe\" not found in edny.",
  "suggestion": "Use GET /api/v1/judges?district_id=edny to list valid judge slugs.",
  "docs_url": "https://docs.courtrules.app/api-reference/judges/list-judges"
}
Validation errors include field-level details:
{
  "error": "Invalid request",
  "details": [{ "path": "document.page_count", "message": "Required" }],
  "docs_url": "https://docs.courtrules.app/api-reference/check/check-document"
}
District access errors include structured context and a contact email:
{
  "error": "District 'sdny' is not yet accessible in your plan.",
  "suggestion": "Contact api@courtrules.app to upgrade your plan for Southern District of New York access.",
  "docs_url": "https://docs.courtrules.app/api-reference/courts",
  "district": {
    "district_id": "sdny",
    "name": "Southern District of New York",
    "status": "preview"
  },
  "accessible_districts": ["edny"],
  "contact": "api@courtrules.app"
}

Rate limits

All endpoints are rate-limited per API key using a sliding window:
EndpointLimit
POST /classify5 RPM
POST /check60 RPM
GET /courts, /judges, /rules300 RPM
Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. When exceeded, the API returns 429 with a Retry-After header. See Rate Limits for retry guidance and common mistakes.

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)
429Rate limit exceeded
502Classification failed (timeout or upstream error on /classify)