Rule and Rulebook Management APIs
The Rule and Rulebook Management APIs enable the creation, updating, retrieval, and management of rules and rulebooks in the Ledger system. These APIs define logic, triggers, and parameters for automating processes, ensuring flexibility and efficiency in managing business workflows.
Rulebook Management
1. Create or Update Rulebook
This allows grouping related rules into a rulebook for streamlined management and execution. For example, a financial institution can create a rulebook for compliance checks and update it with new regulations.
Creates a new rulebook.
Agent supplied information about a rulebook.
The name assigned to the rulebook by the agent.
Response to /api/v1/rulebook/
Collects together a number of different rules that can be applied to ledger processes.
The time at which the rulebook was created in the ledger.
The identifier assigned to the rulebook by the ledger. A positive number.
The time at which the rulebook was last updated in the ledger.
default response to /api/v1/rulebook/
POST /api/v1/rulebook/ HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 69
{
"@type": "cac_ledger_schema_info_ledger_rulebook_info",
"name": "text"
}{
"@type": "cac_ledger_schema_element_ledger_rulebook_elem",
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rulebook_info",
"name": "text"
},
"updated_at": "2026-01-01T00:00:00.000Z"
}2. Retrieve Rulebook
Retrieve a rulebook to review its structure and rules for auditing or analysis. For instance, a compliance officer can fetch a "Fraud Detection" rulebook to evaluate its triggers and logic.
Retrieves an existing rulebook and its included data.
Response to /api/v1/rulebook/{name:[^*]+}
Information about a rulebook in the ledger and the rules it contains.
The time at which the rulebook was created in the ledger.
The identifier assigned to the rulebook by the ledger. A positive number.
The time at which the rulebook was last updated in the ledger.
default response to /api/v1/rulebook/{name:[^*]+}
GET /api/v1/rulebook/{name:[^*]+}?data=text HTTP/1.1
Accept: */*
{
"@type": "cac_ledger_schema_data_ledger_rulebook_data",
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rulebook_info",
"name": "text"
},
"rules": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rule_info",
"name": "text",
"parameters": [
"text"
],
"triggers": [
"INSTRUCTION"
]
},
"revision": 1,
"status": "DISABLED",
"updated_at": "2026-01-01T00:00:00.000Z"
}
],
"updated_at": "2026-01-01T00:00:00.000Z"
}3. List Rulebooks
Provides an overview of all rulebooks for tracking and management. For example, an administrator can list all active rulebooks to monitor their usage and update schedules.
Queries the recorded rulebooks.
Response to /api/v1/rulebook/
No content
default response to /api/v1/rulebook/
GET /api/v1/rulebook/ HTTP/1.1
Accept: */*
No content
Rule Management
1. Create or Update Rule
Allows adding or updating rules to automate specific processes. For example, a new rule can be added to trigger a reconciliation process when a balance discrepancy is detected.
Adds a rule to a rulebook.
Agent supplied information about a rule.
The name assigned to the rule
Parameters that are supplied to the rule's script.
Response to /api/v1/rulebook/{rulebook:[^*]+}
A rule that can be executed by the ledger to influence its responses to requests.
The time at which the rule was created in the ledger.
An identifier assigned by the ledger. A positive number.
The revision number increases with each change to the rule.
Whether the ledger is enabled
The time at which the rule was last updated in the ledger.
default response to /api/v1/rulebook/{rulebook:[^*]+}
POST /api/v1/rulebook/{rulebook:[^*]+} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 114
{
"@type": "cac_ledger_schema_info_ledger_rule_info",
"name": "text",
"parameters": [
"text"
],
"triggers": [
"INSTRUCTION"
]
}{
"@type": "cac_ledger_schema_element_ledger_rule_elem",
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rule_info",
"name": "text",
"parameters": [
"text"
],
"triggers": [
"INSTRUCTION"
]
},
"revision": 1,
"rulebook": {
"@type": "cac_ledger_schema_element_ledger_rulebook_elem",
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rulebook_info",
"name": "text"
},
"updated_at": "2026-01-01T00:00:00.000Z"
},
"status": "DISABLED",
"updated_at": "2026-01-01T00:00:00.000Z"
}2. Retrieve Rule
Retrieve rule details to review its triggers, logic, and configuration. For instance, an auditor can fetch a "Transaction Threshold" rule to ensure it aligns with organizational policies.
Retrieves a rule and its included scripts
Response to /api/v1/rulebook/{rulebook:[^]+}/{rule:[^]+}
Information about a rule on the ledger and the scripts assigned to it.
The time at which the rule was created in the ledger.
An identifier assigned by the ledger. A positive number.
The revision number increases with each change to the rule.
Whether the ledger is enabled
The time at which the rule was last updated in the ledger.
default response to /api/v1/rulebook/{rulebook:[^]+}/{rule:[^]+}
GET /api/v1/rulebook/{rulebook:[^*]+}/{rule:[^*]+}?data=text HTTP/1.1
Accept: */*
{
"@type": "cac_ledger_schema_data_ledger_rule_data",
"created_at": "2026-01-01T00:00:00.000Z",
"id": 1,
"info": {
"@type": "cac_ledger_schema_info_ledger_rule_info",
"name": "text",
"parameters": [
"text"
],
"triggers": [
"INSTRUCTION"
]
},
"revision": 1,
"scripts": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"info": {
"@type": "cac_ledger_schema_info_ledger_script_info",
"basis": [
"text"
],
"language": "INTRINSIC",
"source": "text"
},
"version": 1
}
],
"status": "DISABLED",
"updated_at": "2026-01-01T00:00:00.000Z"
}3. List Rules
Helps analyze and manage all rules in a rulebook. For example, a compliance manager can view all rules in a "Data Validation" rulebook to check for redundancies.
Queries the recorded rules.
Response to /api/v1/rulebook/*/
No content
default response to /api/v1/rulebook/*/
GET /api/v1/rulebook/*/ HTTP/1.1
Accept: */*
No content
4. Transition Rule Status
Enables dynamically enabling or disabling rules as needed. For example, deactivate a rule for seasonal discounts after the promotional period ends.
Changes the status of a rule (idempotent)
Response to /api/v1/rulebook/{rulebook:[^]+}/{rule:[^]+}
Records information about the transition of an element from one status to another.
The address of the element that has transitioned.
The status of the element current with completion of the transition.
The status of the element prior to the transition.
default response to /api/v1/rulebook/{rulebook:[^]+}/{rule:[^]+}
PUT /api/v1/rulebook/{rulebook:[^*]+}/{rule:[^*]+}?status=text HTTP/1.1
Accept: */*
{
"address": "text",
"current_status": "text",
"previous_status": "text"
}Example Use Cases
Compliance Automation: Use these APIs to create and manage rules that enforce compliance with financial regulations, such as anti-money laundering checks.
Fraud Detection: Set up and monitor rules that trigger actions when suspicious activities occur, such as large transactions in high-risk regions.
Workflow Management: Organize related rules into rulebooks for easier handling of complex workflows, like automating data validation and reconciliation tasks.
Last updated

