Skip to content
StraventaDocs

Update a fraud rule

Patches a rule (omitted fields unchanged). Supplying `definition` appends a new version. Requires `fraud.rules.write`.

PATCH
/v1/fraud/rules/{id}

Patches a rule (omitted fields unchanged). Supplying definition appends a new version. Requires fraud.rules.write.

Authorization

bearerAuth
AuthorizationBearer <token>

PayOps platform JWT issued by the auth-service. The tenant_id claim is extracted server-side; callers do NOT send tenant_id in the request body.

In: header

Path Parameters

id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/fraud/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "enabled": false,    "precedence": 5  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "event_type": "payment",
  "enabled": true,
  "definition": {
    "match": "all",
    "conditions": [
      {
        "field": "string",
        "op": "gt",
        "value": null
      }
    ],
    "action": "allow",
    "reason_code": "high_amount"
  },
  "precedence": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": "validation_failed",
  "message": "required field 'value' is missing",
  "request_id": "01JA8BHN2P0ECTXN3J6TBKMS7Q"
}
{
  "error": "forbidden",
  "message": "missing required permission: fraud.rules.write",
  "request_id": "01JA8BHN2P0ECTXN3J6TBKMS7Q"
}
{
  "error": "not_found",
  "message": "rule not found",
  "request_id": "01JA8BHN2P0ECTXN3J6TBKMS7Q"
}

Was this page helpful?