Skip to main content

Rules and Rule Sets

Read the rules derived from a framework, regenerate them, and group rules from several frameworks into named rule sets that document sets are judged against.

Rules are what evaluations check. The platform derives them from the text of a framework document: each rule has a text, an obligation of must, should or may, and where available a section, an applicability, a condition, a threshold and the source_quote, the framework's own words the rule rests on. A rule's origin records whether it is ai (as generated), edited (a person changed it) or manual (a person wrote it). The routes in this section read and regenerate rules; they do not edit single rules.

rule_code is the framework's own numbering when it has one. testable says whether a document can be checked against the rule. source_fields names the captured fields a rule comes from, or is null when unknown. These are the editable rules, not the fields captured from the framework: the extracted fields of a framework are counted separately as rule_count on the framework row.

GET/v1/compliance/frameworks/{documentId}/rules

Rule fields

idstring (uuid)The rule id, used by rule sets.
document_idstring (uuid)The framework document.
positionintegerThe rule's place in the framework's order.
rule_codestring | nullThe framework's own code for the rule.
textstringWhat the rule requires.
obligationstringmust, should or may.
section / applies_to / condition / thresholdstring | nullWhere the rule sits in the framework, whom it applies to, when it applies, and any numeric or time limit.
testablebooleanWhether a document can be checked against the rule.
source_quotestring | nullThe framework's own words the rule rests on.
source_fieldsstring[] | nullNames of the captured fields the rule comes from; null when unknown.
originstringai, edited or manual.
updated_atstring (date-time)When the rule last changed.
POST/v1/compliance/frameworks/{documentId}/rules/generate

Path parameters

documentId*string (uuid)The framework document. Its fields must already be extracted; otherwise the request is refused with 422.
Regenerating replaces the framework's stored rules, including rules a person edited or wrote by hand. Evaluations already made keep the rules they copied, but rule sets that listed the replaced rules refer to rules that no longer exist.

Rule Sets

A rule set is a named, hand-picked list of rules from one or several frameworks. A document set linked to a rule set is judged only against that list instead of every rule of every ON framework, which keeps an evaluation focused on the rules that matter to the documents. Every rule put into a rule set must belong to a framework that is ON and completed; up to 1000 rules fit in one set.

A rule set's view lists only the rules whose framework is ON: rule_ids holds the rules in force and frameworks summarises where they come from. A rule of an OFF framework stays stored in the set but is left out of the view, so turning a framework OFF and ON again loses nothing. updated_at changes with the rules, not with a rename.

GET/v1/compliance/rule-sets
POST/v1/compliance/rule-sets

Body fields

name*string1 to 200 characters.
rule_ids*string[] (uuid)1 to 1000 rule ids from frameworks that are ON and completed.

cURL: Create a rule set

curl -X POST "https://api.talonic.com/v1/compliance/rule-sets" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Supplier onboarding",
    "rule_ids": ["0f3d8a52-1b6c-4e97-a2d4-8c5e91b07f36", "7a19c4e8-5d20-43b1-9f68-d3e0a4b52c19"]
  }'

Response: 201 Rule set

{
  "id": "e41b9d07-2c85-4a3f-b6d1-90f7c2a8e553",
  "name": "Supplier onboarding",
  "rule_ids": ["0f3d8a52-1b6c-4e97-a2d4-8c5e91b07f36", "7a19c4e8-5d20-43b1-9f68-d3e0a4b52c19"],
  "frameworks": [
    { "document_id": "9d0c4f6e-3b1a-4c53-8f0e-2a7b6c1d5e40", "name": "Supplier Code of Conduct", "rule_count": 2 }
  ],
  "created_at": "2026-10-20T10:30:00.000Z",
  "updated_at": "2026-10-20T10:30:00.000Z"
}
PATCH/v1/compliance/rule-sets/{ruleSetId}

Path and body

ruleSetId*string (uuid)Path parameter: the rule set.
namestring1 to 200 characters.
rule_idsstring[] (uuid)1 to 1000 rule ids of frameworks that are ON.
DELETE/v1/compliance/rule-sets/{ruleSetId}

Frequently asked questions

Can I edit a single rule through /v1?+
No. The routes in this reference read the rules of a framework and regenerate them as a whole. Individual rules are edited in the web app, which records the rule's origin as edited or manual.
What does regenerating rules do to my edits?+
Generation replaces the framework's stored rules, edits included, when it succeeds. Evaluations already made keep the rules they copied, so past results still read correctly.
Why is a rule missing from my rule set?+
A rule set lists only the rules whose framework is ON. A rule of an OFF framework stays stored in the set and returns to the view when the framework is turned ON again.
What happens to document sets when I delete a rule set?+
They go back to being judged against every rule of the ON frameworks. Their documents stay.