Skip to main content

Authentication

All API endpoints require a Bearer token in the Authorization header.

Request format

Authorization: Bearer <api_key>

Getting an API key

API keys are issued through the console dashboard at console.courtrules.app. Sign in with your organization account to view and manage your keys. Keys follow the format cr_live_<organization>_<suffix>.

Example request

curl -X GET 'https://api.courtrules.app/api/v1/judges?district_id=edny' \
  -H "Authorization: Bearer YOUR_API_KEY"

Error responses

401 — Missing or malformed header

Returned when the Authorization header is missing or doesn’t use the Bearer scheme.
{
  "error": "Missing or invalid Authorization header. Expected: Bearer <api_key>"
}

403 — Invalid key

Returned when the key is present and well-formed but not recognized.
{
  "error": "Invalid API key"
}

Security notes

  • API keys are sensitive credentials. Do not commit them to version control or expose them in client-side code.
  • Use environment variables to store keys in your application:
export COURT_RULES_API_KEY="cr_live_..."
curl -X GET 'https://api.courtrules.app/api/v1/judges?district_id=edny' \
  -H "Authorization: Bearer $COURT_RULES_API_KEY"