
MattW.95551 (Customer) asked a question.
I would like to add a new rule via API, with some actions, I know that doing this through the website gives a GUI interface for defining rules and their actions, however for doing this via the API I have not been able to find any documentation on the structure and options for constructing the actions object in a request.
Where can I find some documentation on constructing an actions object for this request.
Thanks

Thank you for posting on our Community page.
If you are talking about Group Rules then you can find documentation here: https://developer.okta.com/docs/reference/api/groups/#create-group-rule
You can scroll until you see a Request Example, in which is the actions object and it looks like this:
"actions": {
"assignUserToGroups": {
"groupIds": [
"00gjitX9HqABSoqTB0g3"
]
}
}
If you want to create a Policy Rule you can follow this documentation: https://developer.okta.com/docs/reference/api/policy/#create-a-rule
Here too there is a Request Example and the actions object looks like this:
"actions": {
"signon": {
"access": "ALLOW"
}
}
There is some more information on Actions Objects here: https://developer.okta.com/docs/reference/api/policy/#actions-objects
Thank you,
Marian Cambei
Technical Support Engineer | Okta