Browse the docs
Shield rules
Update or reorder a shield rule
Replace a rule's definition, or move it in the evaluation order.
/api/v1/shield-rules/%7Bid%7Dcurl -X PUT "https://inboundr.net/api/v1/shield-rules/{id}" \
-H "Authorization: Bearer $INBOUNDR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"move": "<move>"
}'This endpoint does one of two things depending on the body you send.
Replace the rule#
Send the same body as Create. It is a whole-object replace rather than a merge: a rule's conditions only mean anything as a set, so "merge my two conditions into your three" has no answer you'd reliably predict.
Set enabled: false to switch a rule off without losing its definition or its
place in the order.
{
"name": "Drop flagged spam",
"action": "block",
"enabled": false,
"conditions": [
{ "field": "spam_verdict", "operator": "equals", "value": "FAIL" }
]
}Move it in the order#
Send only move. The rule swaps places with its neighbour and the whole
account's priorities are renumbered from zero.
{ "move": "up" }movestringbody
up or down. Moving past either end is a no-op, not an error.
To set the whole order at once instead, use Reorder. That's what a drag-and-drop interface needs, since one drag can move a rule across several positions.
Example response
{
"order": ["gr_456", "gr_123", "gr_789"]
}Order decides which of two matching rules fires, so a reorder changes what happens to your mail even though no rule's own definition changed. It is recorded in the account's audit trail.