---
updatedAt: 2025-06-13T00:00:23.000Z
agentTools:
  projectIndex: https://docs.fiatrepublic.com/llms.txt
---

# Rules

## 📏 Rules

Rules are a set of **conditions** checked against processed events (e.g., transactions).\
They enable real-time monitoring by triggering alerts when specified thresholds are met or exceeded.

Rules can be customized to reflect each Member’s risk appetite and operational requirements.

### 🔄 Lifecycle

* **Create Rule**: Define the logic and thresholds for triggering alerts.
* **Update Rule**: Adjust thresholds or rule logic based on changing requirements.

***

### 🛠️ Creating a Rule

Send a `POST` request to: [POST /api/v1/rules](https://docs.fiatrepublic.com/reference/oxygen-create-rule)

***

### 📘 Field Descriptions

| **Field**                                 | **Type**                                                      | **Description**                                                                                                                                            |
| ----------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                                      | `string`                                                      | Unique identifier for the rule.                                                                                                                            |
| `name`                                    | `string`                                                      | Descriptive name of the rule.                                                                                                                              |
| `definition`                              | `object`                                                      | Rule logic configuration block. Contains the template and parameters.                                                                                      |
| `definition.template`                     | `string`                                                      | Type of rule logic used (e.g., `MonthlyTurnoverPercentage`).                                                                                               |
| `definition.percentageThreshold`          | `number`                                                      | Threshold percentage used for triggering the rule.                                                                                                         |
| `definition.timePeriod`                   | `string` ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)) | Time window for evaluating the rule (e.g., `PT48H` = 48 hours).                                                                                            |
| `definition.entityExternalTypes`          | `string[]`                                                    | List of applicable entity types (e.g., `END_USER`, `MEMBER_LEGAL_ENTITY`).                                                                                 |
| `definition.entityType`                   | `string`                                                      | Types of Entity: `INDIVIDUAL` or `BUSINESS`                                                                                                                |
| `definition.counterpartiesCountThreshold` | `integer`                                                     | Threshold of the counterparties which should trigger the alert (equal or more)                                                                             |
| `status`                                  | `string`                                                      | Current status of the rule: `ENABLED` or `DISABLED`.                                                                                                       |
| `categories`                              | `string[]`                                                    | Tags or classification labels for the rule (e.g., `HIGH_VALUE_VOLUMES`).                                                                                   |
| `alert`                                   | `object`                                                      | Settings related to alert generation for the rule.                                                                                                         |
| `alert.raiseNewAfter`                     | `string` (ISO 8601)                                           | Specify when the new alert for the same rule should be triggered, if the alert for this rule and specific entity is still open(e.g., `PT24H`).             |
| `alert.quietPeriod`                       | `string` (ISO 8601)                                           | Specify the time when the alert for the specific entity and rule should not be triggered if there was the same alert created and resolved (e.g., `PT24H`). |
| `alert.eventsOrderedBy`                   | `string`                                                      | Field used to order evaluated events, typically `DATE`.                                                                                                    |
| `createdAt`                               | `integer` (timestamp)                                         | Timestamp when the rule was created (in milliseconds).                                                                                                     |
| `updatedAt`                               | `integer` (timestamp)                                         | Timestamp when the rule was last updated (in milliseconds).                                                                                                |

***

### 🚨 Behavior

When an event (like a transaction) meets the rule’s conditions:

* An **alert** is triggered
* Details of the event and matched rule are logged for review

Rules can be adapted over time to reflect updated compliance policies or operational risk thresholds.