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

# Rule Packs

> Query the normalized policy catalog of managed and custom rule packs

Returns the normalized policy catalog for the active authenticated customer.
Managed entries reflect the Anchor v3 runtime vocabulary. Custom entries are
`v2_frontier` imports that have been activated at least once, including entries
that are currently inactive. Supplying `id` selects detail and requires `type`.

## Query Parameters

<ParamField query="id" type="string">
  Rulepack ID for detail lookup; requires `type`
</ParamField>

<ParamField query="type" type="string">
  `managed` or `custom`. Filter list results or disambiguate a detail ID
</ParamField>

<ParamField query="page" type="integer" default="1">
  One-based result page
</ParamField>

<ParamField query="per_page" type="integer" default="15">
  Results per page (1–100)
</ParamField>

<ParamField query="search" type="string">
  Case-insensitive match against ID, name, or description
</ParamField>

<ParamField query="active" type="string">
  Filter by current runtime active state: `'true'` or `'false'`
</ParamField>

## Response - List

When called without `id`, returns paginated summaries under `data`.

<ResponseField name="data" type="array">
  Rulepack summaries

  <Expandable title="summary properties">
    <ResponseField name="id" type="string">
      Rulepack identifier (e.g., `zd-us-securities`)
    </ResponseField>

    <ResponseField name="name" type="string">
      Human-readable rulepack name
    </ResponseField>

    <ResponseField name="description" type="string">
      Rulepack description (nullable)
    </ResponseField>

    <ResponseField name="type" type="string">
      `managed` or `custom`
    </ResponseField>

    <ResponseField name="engine" type="string">
      Runtime engine vocabulary: `anchor_3_0` or `v2_frontier`
    </ResponseField>

    <ResponseField name="active" type="boolean">
      Whether the rulepack is currently active for this customer
    </ResponseField>

    <ResponseField name="total_rules" type="integer">
      Total rules in the rulepack
    </ResponseField>

    <ResponseField name="active_rules" type="integer">
      Currently active rules
    </ResponseField>

    <ResponseField name="inactive_rules" type="integer">
      Currently inactive rules
    </ResponseField>

    <ResponseField name="publisher" type="string">
      Publisher (nullable)
    </ResponseField>

    <ResponseField name="version" type="string">
      Rulepack version (nullable)
    </ResponseField>

    <ResponseField name="domain" type="string">
      Compliance domain (nullable)
    </ResponseField>

    <ResponseField name="jurisdictions" type="array">
      Applicable jurisdictions
    </ResponseField>

    <ResponseField name="last_updated" type="string">
      Last update date (nullable)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Pagination metadata (nullable)

  <Expandable title="meta properties">
    <ResponseField name="current_page" type="integer">
      Current one-based page
    </ResponseField>

    <ResponseField name="per_page" type="integer">
      Results per page
    </ResponseField>

    <ResponseField name="total" type="integer">
      Total matching rulepacks
    </ResponseField>

    <ResponseField name="last_page" type="integer">
      Last available page
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 OK - List theme={null}
  {
    "data": [
      {
        "id": "zd-us-securities",
        "name": "US Securities and Investment Communications",
        "description": "SEC and FINRA communication compliance",
        "type": "managed",
        "engine": "anchor_3_0",
        "active": true,
        "total_rules": 72,
        "active_rules": 72,
        "inactive_rules": 0,
        "publisher": "ZeroDrift",
        "version": "3.0.0",
        "domain": "securities",
        "jurisdictions": ["US"],
        "last_updated": "2026-07-28"
      }
    ],
    "meta": {
      "current_page": 1,
      "per_page": 15,
      "total": 13,
      "last_page": 1
    }
  }
  ```
</ResponseExample>

## Response - Detail

When called with `id` and `type`, returns one detailed rulepack under `data`,
including its `rules`.

<ResponseField name="data" type="object">
  All summary fields, plus:

  <Expandable title="rule properties">
    <ResponseField name="rules" type="array">
      Rules in the rulepack

      <Expandable title="rule entry properties">
        <ResponseField name="id" type="string">
          Rule identifier
        </ResponseField>

        <ResponseField name="name" type="string">
          Human-readable rule name
        </ResponseField>

        <ResponseField name="description" type="string">
          Rule description (nullable)
        </ResponseField>

        <ResponseField name="type" type="string">
          `AI_SIGNAL`, `REGEX`, `COMPOSITE`, `LEXICON`, `REQUIRE_NEAR`, or `CUSTOM`
        </ResponseField>

        <ResponseField name="severity" type="string">
          Rule severity (nullable)
        </ResponseField>

        <ResponseField name="verdict" type="string">
          `do_not_send` or `send_with_caution`
        </ResponseField>

        <ResponseField name="active" type="boolean">
          Whether the rule is currently active
        </ResponseField>

        <ResponseField name="lifecycle" type="object">
          Lifecycle detail (nullable): `status`, `effective_from`, `last_reviewed`
        </ResponseField>

        <ResponseField name="citations" type="array">
          Regulatory citations with `framework`, `cite`, and `jurisdictions`
        </ResponseField>

        <ResponseField name="remediation" type="object">
          Remediation guidance with `kind` and `note`
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 OK - Detail theme={null}
  {
    "data": {
      "id": "zd-us-securities",
      "name": "US Securities and Investment Communications",
      "type": "managed",
      "engine": "anchor_3_0",
      "active": true,
      "total_rules": 72,
      "active_rules": 72,
      "inactive_rules": 0,
      "rules": [
        {
          "id": "guarantee_of_returns",
          "name": "Promissory Tone",
          "description": "Promissory words are risky",
          "type": "AI_SIGNAL",
          "severity": "major",
          "verdict": "do_not_send",
          "active": true,
          "lifecycle": {
            "status": "in_force",
            "last_reviewed": "2026-07-28"
          },
          "citations": [
            {
              "framework": "FINRA Rule 2210",
              "jurisdictions": ["US"]
            }
          ],
          "remediation": {
            "kind": "rewrite",
            "note": "Review with compliance"
          }
        }
      ]
    }
  }
  ```
</ResponseExample>

## Errors

| Status | Meaning                                                            |
| ------ | ------------------------------------------------------------------ |
| `400`  | Invalid pagination, filter, or detail selector                     |
| `403`  | Forbidden — missing, invalid, inactive, or unresolved API key      |
| `404`  | Rulepack not found or not accessible to this customer              |
| `500`  | Catalog backend read failed or stored catalog data is inconsistent |

## Example

<CodeGroup>
  ```bash cURL - List theme={null}
  curl -X GET "https://api.zerodrift.ai/api/rulepacks/?per_page=15&active=true" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash cURL - Detail theme={null}
  curl -X GET "https://api.zerodrift.ai/api/rulepacks/?id=zd-us-securities&type=managed" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"
  API_BASE = "https://api.zerodrift.ai"

  headers = {"x-api-key": API_KEY}

  # List rulepacks
  response = requests.get(f"{API_BASE}/api/rulepacks/", headers=headers)
  catalog = response.json()
  print(catalog["data"])

  # Get one rulepack's detail (id requires type)
  response = requests.get(
      f"{API_BASE}/api/rulepacks/",
      headers=headers,
      params={"id": "zd-us-securities", "type": "managed"}
  )
  rulepack = response.json()
  print(rulepack["data"]["rules"])
  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');

  const API_KEY = 'YOUR_API_KEY';
  const API_BASE = 'https://api.zerodrift.ai';

  const headers = { 'x-api-key': API_KEY };

  // List rulepacks
  const listResponse = await axios.get(`${API_BASE}/api/rulepacks/`, { headers });
  console.log(listResponse.data.data);

  // Get one rulepack's detail (id requires type)
  const detailResponse = await axios.get(`${API_BASE}/api/rulepacks/`, {
    headers,
    params: { id: 'zd-us-securities', type: 'managed' }
  });
  console.log(detailResponse.data.data.rules);
  ```
</CodeGroup>
