Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idokta.authorizationservers.policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Policy
namestringName of the Policy
_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.
conditionsobject
createdstring (date-time)Timestamp when the Policy was created
descriptionstringDescription of the Policy
lastUpdatedstring (date-time)Timestamp when the Policy was last updated
priorityintegerSpecifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server
statusstringSpecifies whether requests have access to this Policy
systembooleanSpecifies whether Okta created this Policy
typestringIndicates that the Policy is an authorization server Policy

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_authorization_server_policiesselectsubdomainLists all policies
get_authorization_server_policyselectsubdomainRetrieves a policy
create_authorization_server_policyinsertsubdomainCreates a policy
replace_authorization_server_policyreplacesubdomainReplaces a policy
delete_authorization_server_policydeletesubdomainDeletes a policy
activate_authorization_server_policyexecsubdomainActivates an authorization server policy
deactivate_authorization_server_policyexecsubdomainDeactivates an authorization server policy

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 policies

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

INSERT examples

Creates a policy

INSERT INTO okta.authorizationservers.policies (
data__id,
data__type,
data__name,
data__conditions,
data__description,
data__priority,
data__status,
data__system,
subdomain
)
SELECT
'{{ id }}',
'{{ type }}',
'{{ name }}',
'{{ conditions }}',
'{{ description }}',
{{ priority }},
'{{ status }}',
{{ system }},
'{{ subdomain }}'
RETURNING
id,
name,
_links,
conditions,
created,
description,
lastUpdated,
priority,
status,
system,
type
;

REPLACE examples

Replaces a policy

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

DELETE examples

Deletes a policy

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

Lifecycle Methods

Activates an authorization server policy

EXEC okta.authorizationservers.policies.activate_authorization_server_policy 
@subdomain='{{ subdomain }}' --required;