A rule starts work automatically when a certain email arrives or at a set time. You can view your rules in Rules. With svanja rule, you can read rules, save drafts, test them, and control them from the terminal before turning them on. Reading requires the Rules area, which is included in Full access and Read-only keys. Making changes requires Full access or Rules set to Read and write, and turning a rule on requires someone to approve it in the app. See Rules for more details.
Use svanja rule draft and svanja rule update to save a draft. To check how a rule behaves, run svanja rule test. It looks at recent events in Svanja and previews what the rule would have done for up to 10 matches, without sending or changing anything. These previews use a few credits. By contrast, --dry-run only prints the request the command would send.
Running svanja rule enable on its own returns authorization_required and leaves the rule unchanged. Request approval first, approve it in the app using the returned approval_url, and then enable the rule with that approval’s ID:
svanja authorization request --body '{"operation":"rule.enable","input":{"id":"RULE_ID"}}' --json
svanja rule enable RULE_ID --field authorization_request_id=AUTHORIZATION_REQUEST_ID
svanja rule stop-with-tasks pauses a rule and stops any tasks it started.