Skip to content

Replace a group rule

Request

OAuth 2.0 scope:
  • okta.groups.manage

Replaces a group rule

Note: You can only update group rules that have their status set to INACTIVE.

Path
groupRuleIdstringrequired

The id of the group rule

Example:0pr3f7zMZZHPgUoWO0g4
Bodyapplication/jsonrequired
actionsobject(GroupRuleAction)

Defines which users and groups to assign

conditionsobject(GroupRuleConditions)

Defines group rule conditions

namestring, [ 1 .. 50 ] characters

Name of the group rule

statusstring(GroupRuleStatus)

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"
typestring

Type to indicate a group rule operation. Only group_rule is allowed.

Example of a group rule

curl -i -X PUT \
  https://subdomain.okta.com/api/v1/groups/rules/0pr3f7zMZZHPgUoWO0g4 \
  -H 'Content-Type: application/json' \
  -d '{
    "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": {
        "users": {
          "exclude": [
            "00u22w79JPMEeeuLr0g4"
          ]
        },
        "groups": {
          "exclude": []
        }
      },
      "expression": {
        "value": "user.role==\"Engineer\"",
        "type": "urn:okta:expression:1.0"
      }
    },
    "actions": {
      "assignUserToGroups": {
        "groupIds": [
          "00gjitX9HqABSoqTB0g3"
        ]
      }
    }
  }'

Responses

Success

Bodyapplication/json
actionsobject(GroupRuleAction)

Defines which users and groups to assign

conditionsobject(GroupRuleConditions)

Defines group rule conditions

createdstring, (date-time)read-only

Creation date for group rule

idstringread-only

ID of the group rule

lastUpdatedstring, (date-time)read-only

Date group rule was last updated

namestring, [ 1 .. 50 ] characters

Name of the group rule

statusstring(GroupRuleStatus)

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"
typestring

Type to indicate a group rule operation. Only group_rule is allowed.

_embeddedobjectread-only

This object appears with embedded resources related to the group rule if you use the expand query parameter

Response
{ "actions": { "assignUserToGroups": { … } }, "conditions": { "expression": { … }, "people": { … } }, "created": "2019-08-24T14:15:22Z", "id": "string", "lastUpdated": "2019-08-24T14:15:22Z", "name": "string", "status": "ACTIVE", "type": "string", "_embedded": { "groupIdToGroupNameMap": { … } } }