Hello,
The API call used for creating custom rules is
- http://{domain.tld}/Documentation/api#/reference/SmarterMail.Web.Controllers.Api.AntiSpamVirusController/UpdateCustomRules
From here you can adjust as needed. Here is an example API call.
- Request URL: http://{domain.tld}/api/v1/settings/sysadmin/antispam/custom-rules/update
- Request Method: POST
- Status Code: 200 OK
- Body:{{"ItemsToUpdate":[{"name":"SPAM_CHECK_RULE_NAME_2","source":"Header","ruleArgument":"HEADER_RULE_FIELD","matchType":"Contains","weight":0,"matchMultiple":false,"ruleItems":["RULE_TEXT","ONE_PRE_LINE"],"enableFiltering":true,"enableOutgoingSmtpBlocking":true,"new":true}]}
You will need to adjust for what you are wanting to do.
Thank you
Tony Scholz
System/Network Administrator
SmarterTools Inc.
www.smartertools.com