Skip to main content
Version: 1.1

Update a Rule

PATCH https://api.fraudio.com/v1/rules/:rule_id

Endpoint Overview

The "Update Rule" endpoint allows you to modify and adjust a specific fraud detection rule using its unique identifier. This capability ensures that as your organization's requirements change, your fraud prevention measures can evolve to match.

tip

If you face any challenges when updating a rule or need clarity on certain aspects of this endpoint, don't hesitate to contact our Support Team. We're eager to help.

Request Parameters

Path Parameters

The endpoint requires the following path parameter:

  • rule_id: The unique identifier (UUID) of the rule you wish to update.

Example Request With Path Parameter

PATCH https://api.fraudio.com/v1/rules/123e4567-e89b-12d3-a456-426614174000

Request Body

The body of the request should contain the fields of the rule you wish to update. Note: Not all fields may be updatable; refer to the rule object documentation for details on each field.

note

After a successful update, the version of the rule will be incremented by 1.

Example:

"json
{
"name": "Updated Rule Name",
"description": "Updated description for the rule."
}

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 when updating a rule.200 OK - Rule updated response
400Bad RequestResponse when the request body is malformed or contains invalid data.Problem response
404Not FoundResponse when the specified rule ID does not exist.Problem response
4xx, 500, 501, 502, 503, 504errorVarious error messages for unsuccessful HTTP requests.Problem response

Code Samples

curl -X PATCH 'https://api.fraudio.com/v1/rules/YOUR_RULE_ID_HERE' \
-H 'Content-Type: application/json' \
-H "authorisation: Bearer $ACCESS_TOKEN" \
-d '{
"externalId": "new-external-id",
"name": "Updated Rule Name",
"description": "Updated rule description",
"trigger": "transaction.mcccode == 1234",
"action": "review",
"status": "disabled",
"priority": 2
}'