Skip to main content

rules

Creates, updates, deletes, gets or lists a rules resource.

Overview

Namerules
TypeResource
Idokta.authorizationservers.rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringIdentifier of the rule
namestringName of the rule
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
actionsobject
conditionsobject
createdstring (date-time)Timestamp when the rule was created
lastUpdatedstring (date-time)Timestamp when the rule was last modified
priorityintegerPriority of the rule
statusstringStatus of the rule
systembooleanSet to true for system rules. You can't delete system rules.
typestringRule type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_authorization_server_policy_rulesselectsubdomainLists all policy rules for the specified Custom Authorization Server and Policy
get_authorization_server_policy_ruleselectsubdomainRetrieves a policy rule by ruleId
create_authorization_server_policy_ruleinsertsubdomain, data__name, data__conditions, data__typeCreates a policy rule for the specified Custom Authorization Server and Policy
replace_authorization_server_policy_rulereplacesubdomain, data__name, data__conditions, data__typeReplaces the configuration of the Policy Rule defined in the specified Custom Authorization Server and Policy
delete_authorization_server_policy_ruledeletesubdomainDeletes a Policy Rule defined in the specified Custom Authorization Server and Policy
activate_authorization_server_policy_ruleexecsubdomainActivates an authorization server policy rule
deactivate_authorization_server_policy_ruleexecsubdomainDeactivates an authorization server policy rule

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)

SELECT examples

Lists all policy rules for the specified Custom Authorization Server and Policy

SELECT
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type
FROM okta.authorizationservers.rules
WHERE subdomain = '{{ subdomain }}' -- required;

INSERT examples

Creates a policy rule for the specified Custom Authorization Server and Policy

INSERT INTO okta.authorizationservers.rules (
data__actions,
data__conditions,
data__name,
data__priority,
data__status,
data__system,
data__type,
subdomain
)
SELECT
'{{ actions }}',
'{{ conditions }}' --required,
'{{ name }}' --required,
{{ priority }},
'{{ status }}',
{{ system }},
'{{ type }}' --required,
'{{ subdomain }}'
RETURNING
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type
;

REPLACE examples

Replaces the configuration of the Policy Rule defined in the specified Custom Authorization Server and Policy

REPLACE okta.authorizationservers.rules
SET
data__actions = '{{ actions }}',
data__conditions = '{{ conditions }}',
data__name = '{{ name }}',
data__priority = {{ priority }},
data__status = '{{ status }}',
data__system = {{ system }},
data__type = '{{ type }}'
WHERE
subdomain = '{{ subdomain }}' --required
AND data__name = '{{ name }}' --required
AND data__conditions = '{{ conditions }}' --required
AND data__type = '{{ type }}' --required
RETURNING
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type;

DELETE examples

Deletes a Policy Rule defined in the specified Custom Authorization Server and Policy

DELETE FROM okta.authorizationservers.rules
WHERE subdomain = '{{ subdomain }}' --required;

Lifecycle Methods

Activates an authorization server policy rule

EXEC okta.authorizationservers.rules.activate_authorization_server_policy_rule 
@subdomain='{{ subdomain }}' --required;