Skip to main content
Version: 1.1

Create a Rule

POST https://api.fraudio.com/v1/rules

Endpoint Overview

The Rule creation endpoint is part of our Rules Management API, designed to streamline the way you define and handle fraud detection rules within your organization. With this endpoint, you can programmatically add new rules that specify conditions (triggers) and the resulting actions (allow, review, deny). Each rule can be prioritized and enabled or disabled as needed, providing you with robust and flexible control over fraud management.

tip

For any questions or uncertainties regarding this endpoint, our Support Team is available for assistance.

Request Parameters

Request parameters in JSON format

Toggle to view an example of request parameters in JSON format for creating a rule
json
{
"externalId": "rule-1",
"name": "Deny merchant",
"description": "Deny suspicious merchant",
"trigger": "transaction.merchant == \"suspicious-merchant-1\"",
"action": "deny",
"status": "enabled",
"priority": 1
}

Request parameters: Field Reference Table

FieldData TypeDescription
externalIdString
Unique identifier for the rule from an external system.
nameString
Brief title for the rule.
descriptionString
Detailed explanation of the rule's functionality.
triggerString
Logical expressions to evaluate incoming pre-auth transactions.
actionString
Action to take when the trigger is met. Can be allow, review, or deny.
statusString
Current state of the rule. Can be enabled, disabled, or archived.
priorityInteger
Priority level for the rule. Ranges from 1 (highest) to 5 (lowest).

Response Parameters

Status CodeStatus MessageDescriptionSchema
200OKStandard response for successful HTTP requests.200 OK - Rule creation response
4xx, 500, 501, 502, 503, 504errorVarious error messages for unsuccessful HTTP requests.Problem response

Code Samples

curl -X POST 'https://api.fraudio.com/v1/rules' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer $ACCESS_TOKEN" \
--data-raw '{
"externalId":"rule-1",
"name":"Deny merchant",
"description":"Deny suspicious merchant",
"trigger":"transaction.merchant == \"suspicious-merchant-1\"",
"action":"deny",
"status":"enabled",
"priority":1
}'