# Read Rules Fetch rules stored inside a model. Endpoint allows for: * full text search - searching inside: id, name, sparql rule, rule url, passing test case, violating test case for string passed in field * sorting - sorting by allowed values of rules and sorting order (default ascending) * filtering - gives option to limit query result by country and criticality Each functionality can be combined to create complex usage of this endpoint. Endpoint: GET /knowledgegraphs/{knowledgeGraphId}/models/{modelId}/rules Version: 1 Security: apiKey ## Query parameters: - `page` (integer) The number of the page to read. Parameter isn't required, by default, set to '0'. Example: "0" - `pageSize` (integer) Maximum number of elements on the page to read. Parameter isn't required. Can't be negative, by default, set to . Example: "10" - `searchedText` (string) Used to filter objects. Example: "Searched Text" - `searchedCountry` (string) Used to filter objects. Example: "Country" - `searchedCriticality` (string) Used to filter objects. Example: "Criticality" - `searchedStatus` (string) Used to filter objects. Correct values: - Blocked status. - Draft status. - Idea status. - Planned status. - Under review status. Example: "RELEASED" - `ruleUrl` (string) Used to identify rule by its URL. Example: "https://www.cdq.com/rule/isValidEmail" - `publicationStatus` (string) If enabled, start filtering based on publication status. Enum: "PUBLISHED", "UNPUBLISHED" - `sort` (string) Enables sorting of rules by attributes. Enum: "COUNTRY", "CREATED_AT", "CREATED_BY", "CRITICALITY", "LAST_EDITOR", "LAST_MODIFICATION", "NAME", "STATUS" - `sortType` (string) Allows changing the default sorting order (ASC) to desire by user. Enum: "DESC", "ASC" ## Path parameters: - `knowledgeGraphId` (integer, required) Used to identify Knowledge Graph and objects inside it. Example: "1" - `modelId` (integer, required) Used to identify model and objects inside it. Example: "1" ## Header parameters: - `X-Credential-Username` (string, required) Username that is passed as header parameter with the name X-Credential-Username. The header can take a form of: * username (e.g. "johnjoe") * user id (e.g. "87b1bdb1-ba87-4522-b363-c5a0e6e917b3") Example: "87b1bdb1-ba87-4522-b363-c5a0e6e917b3" ## Response 200 fields (application/json): - `pageSize` (integer, required) Number of rules on the page. Example: "10" - `page` (integer, required) Number of the page. Example: "10" - `values` (array, required) List of rules. - `values.id` (integer, required) Rule ID. Example: "1" - `values.url` (string, required) URL of the rule. Example: "https://www.cdq.com/rule/1" - `values.name` (string, required) Name of the rule. Example: "Rule 1" - `values.status` (string, required) Represents the status of a rule. Enum: "ARCHIVED", "BLOCKED", "DEACTIVATED", "DRAFT", "HYPERCARE", "IDEA", "IMPLEMENTED", "PLANNED", "RELEASED", "UNDER_REVIEW" - `values.country` (string) Represents country that rule applies to, valid in ISO-2 format. Example: "DE" - `values.criticality` (string) Represents the severity of the rule; based on this property, different actions can be taken when the rule fails. Enum: "NO_DEFECT", "INFO", "WARNING", "ERROR" - `values.businessRuleType` (string, required) Type of business rule. Enum: "AUTOMATION_RULE", "DATA_QUALITY_RULE" - `values.sparql` (string, required) SPARQL rule that is used for validation of data. Example: "SELECT * WHERE { ?s ?p ?o }" - `values.correctRecord` (string, required) Test case containing a record that passes the validation against SPARQL rule. Example: "SELECT * WHERE { ?s ?p ?o }" - `values.incorrectRecord` (string, required) Test case containing a record that does not pass the validation against SPARQL rule. Example: "SELECT WHERE { ?s ?p ?" - `values.description` (string) Description of the rule. Example: "Rule description" - `values.violationMessage` (string) Message to display when rule fails. Example: "Rule failed" - `values.createdAt` (string, required) Date of creation (ISO 8601-compliant). Example: "2025-08-29T09:46:59Z" - `values.createdBy` (string, required) Creator of a resource. Example: "76248934691294444" - `values.lastModifier` (string, required) Unique ID of a user. Example: "johndoe" - `values.lastModificationDate` (string, required) Date of modification (ISO 8601-compliant). Example: "2025-08-29T09:46:59Z" - `values.publicationStatus` (string) Publication status of the rule. Enum: "PUBLISHED", "UNPUBLISHED" - `values.category` (string) Category of the rule. Example: "Category" - `total` (integer, required) Total number of rules. Example: "10"