---
title: "POST /api/v1/policies"
method: POST
path: "/api/v1/policies"
tags: ["Policy"]
---

# POST /api/v1/policies

`POST /api/v1/policies`

## Request

- Base URL: `https://your-subdomain.okta.com`
- URL: `https://your-subdomain.okta.com/api/v1/policies`
- Auth: API key in header `Authorization`

Creates a policy.

## Query parameters

- `activate` boolean

## Request body

- Policy
  - `_embedded` object
  - `_links` object
  - `conditions` PolicyRuleConditions
    - `app` AppAndInstancePolicyRuleCondition
      - `exclude` AppAndInstanceConditionEvaluatorAppOrInstance[]
        - `id` string
        - `name` string
        - `type` 'APP_TYPE' | 'APP'
      - `include` AppAndInstanceConditionEvaluatorAppOrInstance[]
        - `id` string
        - `name` string
        - `type` 'APP_TYPE' | 'APP'
    - `apps` AppInstancePolicyRuleCondition
      - `exclude` string[]
      - `include` string[]
    - `authContext` PolicyRuleAuthContextCondition
      - `authType` 'ANY' | 'RADIUS'
    - `authProvider` PasswordPolicyAuthenticationProviderCondition
      - `include` string[]
      - `provider` 'ACTIVE_DIRECTORY' | 'ANY' | 'LDAP' | 'OKTA'
    - `beforeScheduledAction` BeforeScheduledActionPolicyRuleCondition
      - `duration` Duration
        - `number` integer
        - `unit` string
      - `lifecycleAction` ScheduledUserLifecycleAction
        - `status` 'ACTIVE' | 'INACTIVE' | 'PENDING' | 'DELETED' | 'EXPIRED_PASSWORD' | 'ACTIVATING' | 'SUSPENDED' | 'DELETING'
    - `clients` ClientPolicyCondition
      - `include` string[]
    - `context` ContextPolicyRuleCondition
      - `expression` string
    - `device` DevicePolicyRuleCondition
      - `migrated` boolean
      - `platform` DevicePolicyRuleConditionPlatform
        - `supportedMDMFrameworks` string[]
        - `types` string[]
      - `rooted` boolean
      - `trustLevel` 'ANY' | 'TRUSTED'
    - `grantTypes` GrantTypePolicyRuleCondition
      - `include` string[]
    - `groups` GroupPolicyRuleCondition
      - `exclude` string[]
      - `include` string[]
    - `identityProvider` IdentityProviderPolicyRuleCondition
      - `idpIds` string[]
      - `provider` 'ANY' | 'OKTA' | 'SPECIFIC_IDP'
    - `mdmEnrollment` MDMEnrollmentPolicyRuleCondition
      - `blockNonSafeAndroid` boolean
      - `enrollment` 'OMM' | 'ANY_OR_NONE'
    - `network` PolicyNetworkCondition
      - `connection` 'ANYWHERE' | 'ZONE'
      - `exclude` string[]
      - `include` string[]
    - `people` PolicyPeopleCondition
      - `groups` GroupCondition
        - `exclude` string[]
        - `include` string[]
      - `users` UserCondition
        - `exclude` string[]
        - `include` string[]
    - `platform` PlatformPolicyRuleCondition
      - `exclude` PlatformConditionEvaluatorPlatform[]
        - `os` PlatformConditionEvaluatorPlatformOperatingSystem
          - `expression` string
          - `type` 'ANDROID' | 'IOS' | 'WINDOWS' | 'OSX' | 'OTHER' | 'ANY'
          - `version` PlatformConditionEvaluatorPlatformOperatingSystemVersion
            - `matchType` 'EXPRESSION' | 'SEMVER'
            - `value` string
        - `type` 'DESKTOP' | 'MOBILE' | 'OTHER' | 'ANY'
      - `include` PlatformConditionEvaluatorPlatform[]
        - `os` PlatformConditionEvaluatorPlatformOperatingSystem
          - `expression` string
          - `type` 'ANDROID' | 'IOS' | 'WINDOWS' | 'OSX' | 'OTHER' | 'ANY'
          - `version` PlatformConditionEvaluatorPlatformOperatingSystemVersion
            - `matchType` 'EXPRESSION' | 'SEMVER'
            - `value` string
        - `type` 'DESKTOP' | 'MOBILE' | 'OTHER' | 'ANY'
    - `risk` RiskPolicyRuleCondition
      - `behaviors` string[]
    - `riskScore` RiskScorePolicyRuleCondition
      - `level` string
    - `scopes` OAuth2ScopesMediationPolicyRuleCondition
      - `include` string[]
    - `userIdentifier` UserIdentifierPolicyRuleCondition
      - `attribute` string
      - `patterns` UserIdentifierConditionEvaluatorPattern[]
        - `matchType` 'SUFFIX' | 'EXPRESSION' | 'STARTS_WITH' | 'EQUALS' | 'CONTAINS'
        - `value` string
      - `type` 'IDENTIFIER' | 'ATTRIBUTE'
    - `userStatus` UserStatusPolicyRuleCondition
      - `value` 'ACTIVE' | 'INACTIVE' | 'PENDING' | 'DELETED' | 'EXPIRED_PASSWORD' | 'ACTIVATING' | 'SUSPENDED' | 'DELETING'
    - `users` UserPolicyRuleCondition
      - `exclude` string[]
      - `inactivity` InactivityPolicyRuleCondition
        - `number` integer
        - `unit` string
      - `include` string[]
      - `lifecycleExpiration` LifecycleExpirationPolicyRuleCondition
        - `lifecycleStatus` string
        - `number` integer
        - `unit` string
      - `passwordExpiration` PasswordExpirationPolicyRuleCondition
        - `number` integer
        - `unit` string
      - `userLifecycleAttribute` UserLifecycleAttributePolicyRuleCondition
        - `attributeName` string
        - `matchingValue` string
  - `created` string, date-time
  - `description` string
  - `id` string
  - `lastUpdated` string, date-time
  - `name` string
  - `priority` integer
  - `status` 'ACTIVE' | 'INACTIVE'
  - `system` boolean
  - `type` 'OAUTH_AUTHORIZATION_POLICY' | 'OKTA_SIGN_ON' | 'PASSWORD' | 'IDP_DISCOVERY' | 'PROFILE_ENROLLMENT' | 'ACCESS_POLICY' | 'MFA_ENROLL'

## Response `200`

Success

- Policy
  - `_embedded` object
  - `_links` object
  - `conditions` PolicyRuleConditions
    - `app` AppAndInstancePolicyRuleCondition
      - `exclude` AppAndInstanceConditionEvaluatorAppOrInstance[]
        - `id` string
        - `name` string
        - `type` 'APP_TYPE' | 'APP'
      - `include` AppAndInstanceConditionEvaluatorAppOrInstance[]
        - `id` string
        - `name` string
        - `type` 'APP_TYPE' | 'APP'
    - `apps` AppInstancePolicyRuleCondition
      - `exclude` string[]
      - `include` string[]
    - `authContext` PolicyRuleAuthContextCondition
      - `authType` 'ANY' | 'RADIUS'
    - `authProvider` PasswordPolicyAuthenticationProviderCondition
      - `include` string[]
      - `provider` 'ACTIVE_DIRECTORY' | 'ANY' | 'LDAP' | 'OKTA'
    - `beforeScheduledAction` BeforeScheduledActionPolicyRuleCondition
      - `duration` Duration
        - `number` integer
        - `unit` string
      - `lifecycleAction` ScheduledUserLifecycleAction
        - `status` 'ACTIVE' | 'INACTIVE' | 'PENDING' | 'DELETED' | 'EXPIRED_PASSWORD' | 'ACTIVATING' | 'SUSPENDED' | 'DELETING'
    - `clients` ClientPolicyCondition
      - `include` string[]
    - `context` ContextPolicyRuleCondition
      - `expression` string
    - `device` DevicePolicyRuleCondition
      - `migrated` boolean
      - `platform` DevicePolicyRuleConditionPlatform
        - `supportedMDMFrameworks` string[]
        - `types` string[]
      - `rooted` boolean
      - `trustLevel` 'ANY' | 'TRUSTED'
    - `grantTypes` GrantTypePolicyRuleCondition
      - `include` string[]
    - `groups` GroupPolicyRuleCondition
      - `exclude` string[]
      - `include` string[]
    - `identityProvider` IdentityProviderPolicyRuleCondition
      - `idpIds` string[]
      - `provider` 'ANY' | 'OKTA' | 'SPECIFIC_IDP'
    - `mdmEnrollment` MDMEnrollmentPolicyRuleCondition
      - `blockNonSafeAndroid` boolean
      - `enrollment` 'OMM' | 'ANY_OR_NONE'
    - `network` PolicyNetworkCondition
      - `connection` 'ANYWHERE' | 'ZONE'
      - `exclude` string[]
      - `include` string[]
    - `people` PolicyPeopleCondition
      - `groups` GroupCondition
        - `exclude` string[]
        - `include` string[]
      - `users` UserCondition
        - `exclude` string[]
        - `include` string[]
    - `platform` PlatformPolicyRuleCondition
      - `exclude` PlatformConditionEvaluatorPlatform[]
        - `os` PlatformConditionEvaluatorPlatformOperatingSystem
          - `expression` string
          - `type` 'ANDROID' | 'IOS' | 'WINDOWS' | 'OSX' | 'OTHER' | 'ANY'
          - `version` PlatformConditionEvaluatorPlatformOperatingSystemVersion
            - `matchType` 'EXPRESSION' | 'SEMVER'
            - `value` string
        - `type` 'DESKTOP' | 'MOBILE' | 'OTHER' | 'ANY'
      - `include` PlatformConditionEvaluatorPlatform[]
        - `os` PlatformConditionEvaluatorPlatformOperatingSystem
          - `expression` string
          - `type` 'ANDROID' | 'IOS' | 'WINDOWS' | 'OSX' | 'OTHER' | 'ANY'
          - `version` PlatformConditionEvaluatorPlatformOperatingSystemVersion
            - `matchType` 'EXPRESSION' | 'SEMVER'
            - `value` string
        - `type` 'DESKTOP' | 'MOBILE' | 'OTHER' | 'ANY'
    - `risk` RiskPolicyRuleCondition
      - `behaviors` string[]
    - `riskScore` RiskScorePolicyRuleCondition
      - `level` string
    - `scopes` OAuth2ScopesMediationPolicyRuleCondition
      - `include` string[]
    - `userIdentifier` UserIdentifierPolicyRuleCondition
      - `attribute` string
      - `patterns` UserIdentifierConditionEvaluatorPattern[]
        - `matchType` 'SUFFIX' | 'EXPRESSION' | 'STARTS_WITH' | 'EQUALS' | 'CONTAINS'
        - `value` string
      - `type` 'IDENTIFIER' | 'ATTRIBUTE'
    - `userStatus` UserStatusPolicyRuleCondition
      - `value` 'ACTIVE' | 'INACTIVE' | 'PENDING' | 'DELETED' | 'EXPIRED_PASSWORD' | 'ACTIVATING' | 'SUSPENDED' | 'DELETING'
    - `users` UserPolicyRuleCondition
      - `exclude` string[]
      - `inactivity` InactivityPolicyRuleCondition
        - `number` integer
        - `unit` string
      - `include` string[]
      - `lifecycleExpiration` LifecycleExpirationPolicyRuleCondition
        - `lifecycleStatus` string
        - `number` integer
        - `unit` string
      - `passwordExpiration` PasswordExpirationPolicyRuleCondition
        - `number` integer
        - `unit` string
      - `userLifecycleAttribute` UserLifecycleAttributePolicyRuleCondition
        - `attributeName` string
        - `matchingValue` string
  - `created` string, date-time
  - `description` string
  - `id` string
  - `lastUpdated` string, date-time
  - `name` string
  - `priority` integer
  - `status` 'ACTIVE' | 'INACTIVE'
  - `system` boolean
  - `type` 'OAUTH_AUTHORIZATION_POLICY' | 'OKTA_SIGN_ON' | 'PASSWORD' | 'IDP_DISCOVERY' | 'PROFILE_ENROLLMENT' | 'ACCESS_POLICY' | 'MFA_ENROLL'

---

[API](https://skmtc.dev/okta/apis/okta-api.md) - [All operations](https://skmtc.dev/okta/apis/okta-api/llms.txt) - [OpenAPI document](https://skmtc.dev/okta/apis/okta-api/revisions/7e5249c30571?raw)
