> ## Documentation Index
> Fetch the complete documentation index at: https://docs.courtrules.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Extracted Rules

> Query validated extracted filing rules from active source documents, including state court e-filing, timing, service, fee, courtesy-copy, and courtroom rules

Use this endpoint when you need filing-rule intelligence directly from the extraction store. It does not use the older federal `/rules` profile shape.

<ParamField query="district_id" type="string">
  Court identifier, such as `il-cook-circuit`, `ca-los-angeles-superior`, or `edny`.
</ParamField>

<ParamField query="judge_slug" type="string">
  Judge, calendar, department, or courtroom slug. Court-level rules use `court`.
</ParamField>

<ParamField query="include_court_rules" type="boolean">
  When `judge_slug` is supplied, include court-level rules where `judge_slug` is `court`. Defaults
  to `true`.
</ParamField>

<ParamField query="logic_type" type="string">
  Filter by structured rule type, such as `ElectronicFilingRule`, `FilingTimingRule`, `ServiceRule`,
  `FilingFeeRule`, or `CourtesyCopyRule`.
</ParamField>

<ParamField query="workflow_phase" type="string">
  Filter by workflow phase, such as `FILING`, `CASE_INITIATION`, or `MOTION_PRACTICE`.
</ParamField>

<ParamField query="case_type" type="string">
  Filter by case type. General rules and rules without an explicit case-type limit are included.
</ParamField>

<ParamField query="q" type="string">
  Search summary, source text, tags, and structured data. Example: `rejected cure`.
</ParamField>

<ParamField query="limit" type="number">
  Maximum rules to return. Defaults to `100`, maximum `500`.
</ParamField>

<RequestExample>
  ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl 'https://api.courtrules.app/api/v1/extracted-rules?district_id=il-cook-circuit&logic_type=ElectronicFilingRule&case_type=civil&limit=25' \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "rules": [
      {
        "rule_id": "7c8b4dd2-1df6-4c34-b33f-0fdf3f4b6734",
        "district_id": "il-cook-circuit",
        "judge_slug": "court",
        "source_url": "https://www.cookcountycourtil.gov/about/circuit-court-rules",
        "source_url_key": "cook-county-circuit-rules",
        "document_version_id": "4b2c4f3a-b31e-47fd-9d8b-6e8c6d3eb7e0",
        "doc_kind": "local_rules",
        "logic_type": "ElectronicFilingRule",
        "workflow_phase": "FILING",
        "content": {
          "source_text": "Verbatim source text from the official rule document.",
          "summary": "Civil filings must be submitted electronically unless an exception applies.",
          "rule_tags": ["e_filing", "civil"],
          "workflow_phase": "FILING",
          "visual_severity": "CRITICAL",
          "structured_data": {
            "logic_type": "ElectronicFilingRule",
            "description": "Civil filings must use the court-approved electronic filing system."
          },
          "citation_source": {
            "section": "General Administrative Order"
          }
        }
      }
    ],
    "meta": {
      "total": 1,
      "limit": 25,
      "district_id": "il-cook-circuit",
      "include_court_rules": true,
      "logic_type": "ElectronicFilingRule",
      "case_type": "civil"
    }
  }
  ```
</ResponseExample>

## Response fields

<ResponseField name="rules" type="array">
  Validated extracted filing rules with provenance.
</ResponseField>

<ResponseField name="content" type="object">
  The validated extracted rule payload. It includes source text, summary, tags, workflow phase,
  severity, structured data, and citation details when captured.
</ResponseField>

<ResponseField name="source_url" type="string">
  Official source URL for the rule.
</ResponseField>

<ResponseField name="document_version_id" type="string">
  Source document version used for the extraction.
</ResponseField>

## Filtering behavior

When `judge_slug` is provided, the endpoint returns rules for that unit. With `include_court_rules=true`, the response also includes court-level rules for the same court. This lets clients combine court rules with judge, calendar, department, or courtroom overrides.

This endpoint exposes raw extracted rules first. It does not yet resolve conflicts or compute the final effective rule set for a filing.
