Skip to content

Create a policy

Request

OAuth 2.0 scope:
  • okta.authorizationServers.manage

Creates a policy

Path
authServerIdstringrequired

id of the Authorization Server

Example:GeGRTEr7f3yu2n7grw22
Bodyapplication/jsonrequired
idstring

ID of the Policy

typestring

Indicates that the Policy is an authorization server Policy

Value:"OAUTH_AUTHORIZATION_POLICY"
namestring, [ 1 .. 100 ] characters

Name of the Policy

conditionsobject(AuthorizationServerPolicyConditions)
descriptionstring, [ 1 .. 255 ] characters

Description of the Policy

priorityinteger

Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server

statusstring

Specifies whether requests have access to this Policy

Enum:"ACTIVE""INACTIVE"
systemboolean

Specifies whether Okta created this Policy

curl -i -X POST \
  https://subdomain.okta.com/api/v1/authorizationServers/GeGRTEr7f3yu2n7grw22/policies \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "OAUTH_AUTHORIZATION_POLICY",
    "status": "ACTIVE",
    "name": "Default Policy",
    "description": "Default policy description",
    "priority": 1,
    "system": false,
    "conditions": {
      "clients\"": {
        "include\"": [
          "ALL_CLIENTS"
        ]
      }
    }
  }'

Responses

Created

Bodyapplication/json
idstring

ID of the Policy

typestring

Indicates that the Policy is an authorization server Policy

Value:"OAUTH_AUTHORIZATION_POLICY"
namestring, [ 1 .. 100 ] characters

Name of the Policy

conditionsobject(AuthorizationServerPolicyConditions)
descriptionstring, [ 1 .. 255 ] characters

Description of the Policy

priorityinteger

Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server

statusstring

Specifies whether requests have access to this Policy

Enum:"ACTIVE""INACTIVE"
systemboolean

Specifies whether Okta created this Policy

createdstring, (date-time)read-only

Timestamp when the Policy was created

lastUpdatedstring, (date-time)read-only

Timestamp when the Policy was last updated

Response
{ "type": "OAUTH_AUTHORIZATION_POLICY", "id": "00palyaappA22DPkj0h7", "status": "ACTIVE", "name": "Vendor2 Policy", "description": "Vendor2 policy description", "priority": 1, "system": false, "conditions": { "clients": { … } }, "created": "2017-05-26T19:43:53.000Z", "lastUpdated": "2017-06-07T15:28:17.000Z", "_links": { "self": { … }, "deactivate": { … }, "rules": { … } } }