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

# Create Rule

Exemplary payload.\
Optional fields are commented.

```json Singular Transaction Rule
{
    "status": "ENABLED",
    "name": "Single transaction over 2500",
    "definition": {
        "template": "SingularTransaction",
        "amountThreshold" : "2500.00"
        //"entityRisk": "MEDIUM",
        //"direction": "PAYOUT",
        //"jurisdictions": ["ZW"]
    }, 
    "alert": {
        "raiseNewAfter": "PT1S",
        "eventsOrderedBy": "DATE"
    }
}
```
```json Fast In Fast Out Rule
{
    "status": "ENABLED",
    "name": "80% of deposits from last 7 days withdrawn in last 8h",
    "definition": {
        "template": "FastInFastOut",
        "timePeriodWithdrawals": "P7D",
        "timePeriodDeposits": "PT8H",
        "percentageThreshold": "80.0",
       // "amountThreshold": "5000.00"
    },
    "alert": {
        "raiseNewAfter": "P7D",
        "eventsOrderedBy": "DATE"
    }
}
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "transaction-monitoring",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://sandbox-oxygen.fiatrepublic.com/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/rules": {
      "post": {
        "summary": "Create Rule",
        "description": "",
        "operationId": "oxygen-create-rule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Rule Name"
                  },
                  "definition": {
                    "type": "object",
                    "description": "[IMPORTANT] In one request you can create only one rule",
                    "properties": {
                      "Activity on dormant account": {
                        "type": "object",
                        "required": [
                          "template",
                          "cumulativeTimePeriod",
                          "cumulativeAmountThreshold",
                          "timePeriod"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "ActivityOnDormantAccount"
                            ]
                          },
                          "cumulativeTimePeriod": {
                            "type": "string",
                            "description": "Specify period of transactions to monitor since the dormancy",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "cumulativeAmountThreshold": {
                            "type": "string",
                            "description": "Minimum threshold which should trigger the alert"
                          },
                          "timePeriod": {
                            "type": "string",
                            "description": "Specify dormancy period",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "entityRisk": {
                            "type": "string",
                            "description": "Specify for which risk level you want to implement this rule, if for all you can leave this field empty",
                            "enum": [
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ]
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Cumulative transaction amount": {
                        "type": "object",
                        "required": [
                          "template",
                          "amountThreshold",
                          "timePeriod"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "CumulativeTransactionAmount"
                            ]
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Threshold of the transaction which should trigger the alert (equal or more)"
                          },
                          "timePeriod": {
                            "type": "string",
                            "description": "Specify time period for transactions",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "entityRisk": {
                            "type": "string",
                            "description": "Specify for which risk level you want to implement this rule, if for all you can leave this field empty",
                            "enum": [
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ]
                          },
                          "direction": {
                            "type": "string",
                            "description": "Payin or payout depending on which transaction should trigger the alert. If not provided rule will apply to both",
                            "enum": [
                              "PAYIN",
                              "PAYOUT",
                              ""
                            ]
                          },
                          "age": {
                            "type": "object",
                            "description": "Relates to INDIVIDUAL entity type",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Fast in fast out": {
                        "type": "object",
                        "required": [
                          "template",
                          "timePeriodDeposits",
                          "timePeriodWithdrawals",
                          "percentageThreshold"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "FastInFastOut"
                            ]
                          },
                          "timePeriodDeposits": {
                            "type": "string",
                            "description": "Specify time period for deposits",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "timePeriodWithdrawals": {
                            "type": "string",
                            "description": "Specify time period for withdrawals",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "percentageThreshold": {
                            "type": "string",
                            "description": "Specify how many percent of the funds deposited should have been withdrawn in order for alert to be triggered"
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Amount threshold in 2 decimal places."
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "High volumes on new entity": {
                        "type": "object",
                        "required": [
                          "accountTimePeriod",
                          "cumulativeAmountThreshold"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "HighVolumesOnNewEntity"
                            ]
                          },
                          "accountTimePeriod": {
                            "type": "string",
                            "description": "Time since the entity has been created",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "cumulativeAmountThreshold": {
                            "type": "string",
                            "description": "Minimum threshold which should trigger the alert. Ex: 80.0"
                          },
                          "direction": {
                            "type": "string",
                            "description": "Payin or payout depending on which transaction should trigger the alert. If not provided rule will apply to both",
                            "enum": [
                              "PAYIN",
                              "PAYOUT",
                              ""
                            ]
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "dateToConsider": {
                            "type": "string",
                            "description": "Date of creation in Member's system (EXTERNAL_CREATED_AT) or date of creation on Fiat Republic platform (CREATED_AT)",
                            "enum": [
                              "EXTERNAL_CREATED_AT",
                              "CREATED_AT"
                            ]
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Single transaction over threshold": {
                        "type": "object",
                        "required": [
                          "template",
                          "amountThreshold"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "SingularTransaction"
                            ]
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Threshold of the transaction which should trigger the alert (equal or more)"
                          },
                          "entityRisk": {
                            "type": "string",
                            "description": "Specify for which risk level you want to implement this rule, if for all you can leave this field empty",
                            "enum": [
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ]
                          },
                          "direction": {
                            "type": "string",
                            "description": "Payin or payout depending on which transaction should trigger the alert",
                            "enum": [
                              "PAYIN",
                              "PAYOUT",
                              ""
                            ]
                          },
                          "jurisdictions": {
                            "type": "string",
                            "description": "Specify for transactions from which jurisdictions you want the alert to be triggered (if not provided, will be triggered for all). Ex. [GB, NL, PL, US]"
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Spike in avg activity": {
                        "type": "object",
                        "required": [
                          "template",
                          "shortPeriod",
                          "longPeriod",
                          "amountThreshold",
                          "thresholdPercentage",
                          "transactionCountThreshold"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "SpikeInAvgActivity"
                            ]
                          },
                          "shortPeriod": {
                            "type": "string",
                            "description": "Specify short period of the spike in activity",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "longPeriod": {
                            "type": "string",
                            "description": "Specify period of average activity which will be compared with short period",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Threshold of the transaction which should trigger the alert (equal or more)"
                          },
                          "thresholdPercentage": {
                            "type": "string",
                            "description": "Specify how many percent of the funds deposited should have been withdrawn in order for alert to be triggered. Ex: 80.0"
                          },
                          "transactionCountThreshold": {
                            "type": "string",
                            "description": "Specify how many transactions minimum have to be deposited in order for alert to be triggered. Ex: 1,3,5"
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "description": "INDIVIDUAL, BUSINESS",
                            "enum": [
                              ""
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Structured transactions": {
                        "type": "object",
                        "required": [
                          "template",
                          "timePeriod",
                          "amountThreshold",
                          "amountPercentage",
                          "transactionCountThreshold"
                        ],
                        "properties": {
                          "template": {
                            "type": "string",
                            "enum": [
                              "StructuredTransactions"
                            ]
                          },
                          "timePeriod": {
                            "type": "string",
                            "description": "Specify time period for structured transactions",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Threshold of the transaction which should trigger the alert (equal or more)"
                          },
                          "amountPercentage": {
                            "type": "string",
                            "description": "Specify the percentage of the threshold which should trigger the alert. Ex: 80.0"
                          },
                          "transactionCountThreshold": {
                            "type": "string",
                            "description": "Specify how many transactions minimum have to be deposited in order for alert to be triggered. Ex: 1"
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Numerous Counterparties": {
                        "type": "object",
                        "required": [
                          "timePeriod"
                        ],
                        "properties": {
                          "counterpartiesCountThreshold": {
                            "type": "integer",
                            "description": "Threshold of the counterparties which should trigger the alert (equal or more)",
                            "format": "int64"
                          },
                          "direction": {
                            "type": "string",
                            "description": "Payin or payout depending on which transaction should trigger the alert"
                          },
                          "timePeriod": {
                            "type": "string",
                            "description": "Specify time period for transactions",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "amountThreshold": {
                            "type": "string",
                            "description": "Threshold of the transaction which should trigger the alert (equal or more)"
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "enum": [
                              "INDIVIDUAL",
                              "BUSINESS"
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "Monthly Turnover Percentage": {
                        "type": "object",
                        "properties": {
                          "percentageThreshold": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "timePeriod": {
                            "type": "string",
                            "description": "Specify time period for transactions",
                            "enum": [
                              "4h",
                              "8h",
                              "12h",
                              "1d",
                              "2d",
                              "7d",
                              "14d",
                              "30d",
                              "45d",
                              "60d",
                              "90d"
                            ]
                          },
                          "entityRisk": {
                            "type": "string",
                            "description": "Specify for which risk level you want to implement this rule, if for all you can leave this field empty",
                            "enum": [
                              "LOW",
                              "MEDIUM",
                              "HIGH"
                            ]
                          },
                          "age": {
                            "type": "object",
                            "properties": {
                              "condition": {
                                "type": "string",
                                "enum": [
                                  "ABOVE",
                                  "BELOW"
                                ]
                              },
                              "value": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          },
                          "entityType": {
                            "type": "string",
                            "description": "INDIVIDUAL, BUSINESS",
                            "enum": [
                              ""
                            ]
                          },
                          "entityExternalTypes": {
                            "type": "array",
                            "description": "[\"END_USER\", \"USER\", \"CLIENT\"]",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  "alert": {
                    "type": "object",
                    "properties": {
                      "raiseNewAfter": {
                        "type": "string",
                        "description": "Specify when the new alert for the same rule should be triggered, if the alert for this rule and specific entity is still open",
                        "enum": [
                          "1s",
                          "1h",
                          "4h",
                          "8h",
                          "12h",
                          "1d",
                          "2d",
                          "7d",
                          "14d",
                          "30d",
                          "45d",
                          "60d",
                          "90d"
                        ]
                      },
                      "eventsOrderedBy": {
                        "type": "string",
                        "description": "Specify if the events for alert should be ordered by value or date",
                        "enum": [
                          "DATE",
                          "VALUE"
                        ]
                      },
                      "quietPeriod": {
                        "type": "string",
                        "description": "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",
                        "enum": [
                          "1s",
                          "1h",
                          "4h",
                          "8h",
                          "12h",
                          "1d",
                          "2d",
                          "7d",
                          "14d",
                          "30d",
                          "45d",
                          "60d",
                          "90d"
                        ]
                      }
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ENABLED"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```