---
title: "Search validation rules"
method: GET
path: "/api/v1/rules/search"
tags: ["Open API", "Rules"]
---

# Search validation rules

`GET /api/v1/rules/search`

## Request

- Base URL: `https://developer.claimmind.life` (the document declares no server; this is the origin it was published from)
- URL: `https://developer.claimmind.life/api/v1/rules/search`
- Auth: none declared. Required headers: `X-API-Key`

Search and filter validation rules for the tenant.

    **Use Case:** Retrieve validation rules to understand claim requirements or debug validation failures.

    **Authentication:** API Key (X-API-Key header)
    **Required Scope:** `rules:read`

    **Search Parameters:**
    - q: Search query (use "*" for all rules)
    - scope: Rule scope - "tenant" (custom rules) or "system" (system rules)
    - severity: Filter by severity - ERROR | WARNING | INFO
    - status: Filter by status - ACTIVE | INACTIVE
    - icd10: Filter rules applicable to specific ICD-10 diagnosis code
    - icd9: Filter rules applicable to specific ICD-9 procedure code
    - sex: Filter rules for specific patient gender (M/F)
    - category: Filter by document category
    - care_type: Filter by care type (Rawat Inap/Rawat Jalan)
    - sort: Sort field (e.g., "created_at", "-priority")
    - page: Page number (starting from 1)
    - per_page: Results per page (max 100)

    **Response Format:**
    - rules: Array of validation rules
      - rule_id: Unique rule identifier
      - rule_code: Human-readable code
      - rule_name: Display name
      - description: Rule explanation
      - severity: ERROR | WARNING | INFO
      - status: ACTIVE | INACTIVE
      - condition: Validation logic
    - pagination: Page metadata (total, current_page, per_page)

    **Use Cases:**
    - List all active ERROR rules before submitting claims
    - Search rules by ICD code to understand specific diagnosis requirements
    - Debug validation failures by finding rule details

    **Example Request:**
    ```
    GET /rules/search?q=*&scope=tenant&severity=ERROR&status=ACTIVE&page=1&per_page=20
    ```

    **Example Response:**
    ```json
    {
        "rules": [
            {
                "rule_id": "rule-uuid-123",
                "rule_code": "R-001",
                "rule_name": "Diagnosis Gender Match",
                "description": "Pregnancy diagnosis must match female gender",
                "severity": "ERROR",
                "status": "ACTIVE",
                "condition": {
                    "if": "diagnosis.code starts with 'O'",
                    "then": "patient.gender == 'F'"
                }
            }
        ],
        "pagination": {
            "total": 45,
            "page": 1,
            "per_page": 20,
            "total_pages": 3
        }
    }
    ```

    **Integration Tips:**
    - Cache rules locally to avoid repeated queries
    - Use scope=tenant to see only custom rules
    - Filter by icd10/icd9 to understand diagnosis-specific requirements
    - Use status=ACTIVE to see only enforced rules

## Query parameters

- `q` string: Search query
- `scope` string: Rule scope (tenant or system)
- `severity` string, nullable: Filter by severity
- `sex` string, nullable: Filter by patient gender
- `status` string, nullable: Filter by status (ACTIVE/INACTIVE)
- `icd10` string, nullable: Filter by ICD-10 code
- `icd9` string, nullable: Filter by ICD-9 code
- `category` string, nullable: Filter by document category
- `care_type` string, nullable: Filter by care type
- `documents_to_validate` string, nullable: Filter by documents to validate
- `sort` string, nullable: Sort field
- `page` integer: Page number
- `per_page` integer: Results per page

## Headers

- `X-API-Key` string, required

## Response `200`

Rules retrieved successfully

- unknown

## Other responses

- `403`: Insufficient permissions
- `422`: Validation Error

---

[API](https://skmtc.dev/claimmind/apis/claimmind-open-api-service.md) - [All operations](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/claimmind/apis/claimmind-open-api-service/revisions/ee8bfbeadb8a?raw)
