# Python-SDK sample code for network zones

**URL:** <https://devforum.okta.com/t/python-sdk-sample-code-for-network-zones/33040>\
**Category:** API\
**Tags:** python\
**Created:** [May 2, 2025, 10:00pm UTC](https://devforum.okta.com/t/python-sdk-sample-code-for-network-zones/33040 "2025-05-02T22:00:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheScriptGuy](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@TheScriptGuy](https://devforum.okta.com/u/TheScriptGuy)\
**Post date:** [May 2, 2025, 10:00pm UTC](https://devforum.okta.com/t/python-sdk-sample-code-for-network-zones/33040/1 "2025-05-02T22:00:47Z")

</div>

Hi,

I’m struggling to find sample documentation of how to list all network zones, get information about a network zone and create a new network zone. I’m specifically interested in the feature where I can add ASN’s to a network zone object to be blocked. Can someone please provide some sample code that I can expand upon?

TIA

---

<div class="post-metadata">

**Author:** ![vk-giri](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/vk-giri/32/5178_2.png) [@vk-giri](https://devforum.okta.com/u/vk-giri)\
**Post date:** [May 26, 2025, 4:06am UTC](https://devforum.okta.com/t/python-sdk-sample-code-for-network-zones/33040/2 "2025-05-26T04:06:03Z")

</div>

HI,

Can you try out the `list_network_zones` to see if you are able to fetch the list of all network zones. You can find out the related methods regarding Network zones in this file - [okta-sdk-python/okta/resource\_clients/network\_zone\_client.py at e9764a4b24d998b6240c4a1bb5cb2d577a03252e · okta/okta-sdk-python · GitHub](https://github.com/okta/okta-sdk-python/blob/e9764a4b24d998b6240c4a1bb5cb2d577a03252e/okta/resource_clients/network_zone_client.py#L87)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [June 25, 2025, 4:06am UTC](https://devforum.okta.com/t/python-sdk-sample-code-for-network-zones/33040/3 "2025-06-25T04:06:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
