Skip to content

Replace a network zone

Request

OAuth 2.0 scope:
  • okta.networkZones.manage

Replaces a Network Zone by zoneId. The replaced Network Zone type must be the same as the existing type. You can replace the usage (POLICY, BLOCKLIST) of a Network Zone by updating the usage attribute.

IP exempt zone
If you have the IP exempt zone feature enabled, you can allow traffic from specific gateway IPs irrespective of Okta ThreatInsight configurations, blocked network zones, or IP change events within Identity Threat Protection.

When you enable this feature, Okta creates a zone called DefaultExemptIpZone. Gateway IPs that you add to this zone always have access to Okta resources. See IP exempt zone.

Note: You can't add trusted proxy IPs to this zone, delete the zone, or create additional exempt IP zones.

Path
zoneIdstringrequired

id of the Network Zone

Example:nzowc1U5Jh5xuAK0o0g3
Bodyapplication/jsonrequired
namestring, <= 128 charactersrequired

Unique name for this Network Zone

statusstring(NetworkZoneStatus)

Network Zone status

Enum:"ACTIVE""INACTIVE"
typestring(NetworkZoneType)required

The type of Network Zone

Enum:"DYNAMIC""IP""DYNAMIC_V2"
Discriminator
usagestring(NetworkZoneUsage)

The usage of the Network Zone

Enum:"BLOCKLIST""POLICY"
useAsExemptListboolean

You can only use this parameter when making a request to the Replace the network zone endpoint (/api/v1/zones/{zoneId}). Set this parameter to true in your request when you update the DefaultExemptIpZone to allow IPs through the blocklist.

gatewaysArray of objects(NetworkZoneAddress)

The IP addresses (range or CIDR form) for an IP Network Zone. The maximum array length is 150 entries for admin-created IP zones, 1000 entries for IP blocklist zones, and 5000 entries for the default system IP Zone.

proxiesArray of objects or null(NetworkZoneAddress)

The IP addresses (range or CIDR form) that are allowed to forward a request from gateway addresses for an IP Network Zone. These proxies are automatically trusted by Threat Insights and used to identify the client IP of a request. The maximum array length is 150 entries for admin-created zones and 5000 entries for the default system IP Zone.

curl -i -X PUT \
  https://subdomain.okta.com/api/v1/zones/nzowc1U5Jh5xuAK0o0g3 \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "IP",
    "id": "nzovw2rFz2YoqmvwZ0g9",
    "name": "UpdatedNetZone",
    "status": "ACTIVE",
    "system": false,
    "usage": "POLICY",
    "gateways": [
      {
        "type": "CIDR",
        "value": "10.2.3.4/24"
      },
      {
        "type": "CIDR",
        "value": "12.2.3.4/24"
      },
      {
        "type": "RANGE",
        "value": "13.4.5.6-13.4.5.8"
      },
      {
        "type": "CIDR",
        "value": "14.2.3.4/24"
      }
    ],
    "proxies": [
      {
        "type": "CIDR",
        "value": "12.2.3.4/24"
      },
      {
        "type": "CIDR",
        "value": "13.3.4.5/24"
      },
      {
        "type": "RANGE",
        "value": "14.4.5.6-14.4.5.8"
      },
      {
        "type": "RANGE",
        "value": "15.5.6.7/24-15.5.6.9"
      }
    ],
    "_links": {
      "self": {
        "href": "https://{yourOktaDomain}/api/v1/zones/nzovw2rFz2YoqmvwZ0g9",
        "hints": {
          "allow": [
            "GET",
            "PUT",
            "DELETE"
          ]
        }
      },
      "deactivate": {
        "href": "https://{yourOktaDomain}/api/v1/zones/nzovw2rFz2YoqmvwZ0g9/lifecycle/deactivate",
        "hints": {
          "allow": [
            "POST"
          ]
        }
      }
    }
  }'

Responses

Success

Bodyapplication/json
createdstring, (date-time)read-only

Timestamp when the object was created

idstringread-only

Unique identifier for the Network Zone

lastUpdatedstring, (date-time)read-only

Timestamp when the object was last modified

namestring, <= 128 charactersrequired

Unique name for this Network Zone

statusstring(NetworkZoneStatus)

Network Zone status

Enum:"ACTIVE""INACTIVE"
systembooleanread-only

Indicates a system Network Zone:

  • true for system Network Zones
  • false for custom Network Zones

The Okta org provides the following default system Network Zones:

  • LegacyIpZone
  • BlockedIpZone
  • DefaultEnhancedDynamicZone
  • DefaultExemptIpZone

Admins can modify the name of the default system Network Zone and add up to 5000 gateway or proxy IP entries.

typestring(NetworkZoneType)required

The type of Network Zone

Enum:"DYNAMIC""IP""DYNAMIC_V2"
Discriminator
usagestring(NetworkZoneUsage)

The usage of the Network Zone

Enum:"BLOCKLIST""POLICY"
useAsExemptListboolean

You can only use this parameter when making a request to the Replace the network zone endpoint (/api/v1/zones/{zoneId}). Set this parameter to true in your request when you update the DefaultExemptIpZone to allow IPs through the blocklist.

gatewaysArray of objects(NetworkZoneAddress)

The IP addresses (range or CIDR form) for an IP Network Zone. The maximum array length is 150 entries for admin-created IP zones, 1000 entries for IP blocklist zones, and 5000 entries for the default system IP Zone.

proxiesArray of objects or null(NetworkZoneAddress)

The IP addresses (range or CIDR form) that are allowed to forward a request from gateway addresses for an IP Network Zone. These proxies are automatically trusted by Threat Insights and used to identify the client IP of a request. The maximum array length is 150 entries for admin-created zones and 5000 entries for the default system IP Zone.

Response
{ "type": "IP", "id": "nzovw2rFz2YoqmvwZ0g9", "name": "UpdatedNetZone", "status": "ACTIVE", "usage": "POLICY", "created": "2022-05-08T18:25:05.000Z", "lastUpdated": "2022-05-10T13:15:22.000Z", "system": false, "gateways": [ { … }, { … }, { … }, { … } ], "proxies": [ { … }, { … }, { … }, { … } ], "_links": { "self": { … }, "deactivate": { … } } }