As far as I understand the api-explorer online documentation you would have to use “POST /rules”.
I didn’t find any example but these two threads:
Based on the first one I would suggest to create a rule manually via the UI and compare the parameter that you havein the code explorer via the code in your rule.