Home / Home / Errors / Error: rule_error

Error: rule_error

The rule payload failed validation. The API names the exact problem: invalid_rule_type, invalid_rule_action, invalid_rule_params, invalid_rule_priority, or invalid_rule_label.

What it means

Rules are validated when created (and when updated). A malformed rule is rejected before it can affect any transaction.

The validation error names

invalid_rule_type — unknown rule type (e.g. not per_transaction_cap, daily_ceiling, velocity_limit, merchant_allowlist, category_rule, time_of_day).

invalid_rule_action — action must be one of the supported decisions (approve / block / flag).

invalid_rule_params — parameters for the rule type are missing or out of range.

invalid_rule_priority — priority isn't a valid finite number in the accepted range.

invalid_rule_label — label is malformed or too long.

How to fix

Use one of the documented rule types and actions.

Check params against the type: a cap needs max; an allowlist needs the merchant list; a velocity rule needs count and window.

Keep labels short and plain.

At a glance

FieldValue
HTTP status400
Error coderule_error (invalid_rule_type / invalid_rule_action / invalid_rule_params / invalid_rule_priority / invalid_rule_label)
Response shape{"error": "invalid_rule_params"}
Rule storedNo

Valid rule example

{
  "type": "per_transaction_cap",
  "action": "block",
  "params": {"max": 500, "currency": "USD"},
  "priority": 1,
  "label": "Block any single transaction over $500"
}

Match type, action, and params or you get a named rule_error.

FAQ

Where can I see the supported rule types?

The six enforced rule types are per-transaction cap, daily/period total, velocity limit, merchant allowlist, category rule, and time-of-day rule.

What does invalid_rule_params cover?

Missing or out-of-range parameters for the rule type — e.g. a cap without max, or a velocity rule with a negative window.

Does a bad rule affect existing rules?

No. Rejected rules are never stored; your existing rules keep enforcing.

Related

Stop the next $12,400 night.

One API call (or MCP tool) in front of every agent transaction — APPROVED, BLOCKED, or FLAGGED, deterministic, ~5 ms, fully logged.

See plans — from $99/mo Try a live check