Okta Admin Management API
/Groups
//
Create a group rule
OAuth 2.0 scope:
- okta.groups.manage
Creates a group rule to dynamically add users to the specified group if they match the condition.
Note: Group rules are created with the status set to
'INACTIVE'.
- https://subdomain.okta.comhttps://subdomain.okta.com/api/v1/groups/rules
curl -i -X POST \
https://subdomain.okta.com/api/v1/groups/rules \
-H 'Content-Type: application/json' \
-d '{
"type": "group_rule",
"name": "Engineering group rule",
"conditions": {
"people": {
"users": {
"exclude": [
"00u22w79JPMEeeuLr0g4"
]
},
"groups": {
"exclude": []
}
},
"expression": {
"value": "user.role==\"Engineer\"",
"type": "urn:okta:expression:1.0"
}
},
"actions": {
"assignUserToGroups": {
"groupIds": [
"00gjitX9HqABSoqTB0g3"
]
}
}
}'Success
Status of group rule. You can't update the status of a rule from INACTIVE to ACTIVE. You must use the activate and deactivate lifecycle operations.
Enum:"ACTIVE""INACTIVE""INVALID"
Response
Example of a group rule
{ "type": "group_rule", "id": "0pr3f7zMZZHPgUoWO0g4", "status": "INACTIVE", "name": "Engineering group rule", "created": "2016-12-01T14:40:04.000Z", "lastUpdated": "2016-12-01T14:40:04.000Z", "conditions": { "people": { … }, "expression": { … } }, "actions": { "assignUserToGroups": { … } } }