Skip to main content

UrlCategory

Url Category resource for Zscaler Internet Access.

Resource operations

This resource supports the following standard methods: create(), load(), update(), delete(). They operate on the instance state — set properties with dot notation, then call the method with no arguments. Any other action listed below is a custom action that takes explicit keyword arguments and returns a value.

Quick Start​

import zssdk
import logging

# Enable debug logging for UrlCategory
logging.getLogger('zssdk.zia').setLevel(logging.DEBUG)
logging.basicConfig(level=logging.DEBUG)

session = zssdk.Session(
vanity_domain="your-vanity-domain",
client_id="your-client-id",
client_secret="your-client-secret",
)

# Get a specific UrlCategory
resource = session.zia.UrlCategory(id="your-resource-id")
resource.load()
print(resource)

# Debug output shows HTTP request/response details

Identifiers​

NameTypeDescription
idstringUnique identifier

Actions​

add_url_categories_with_matching_domains()​

Parameters:

NameTypeRequiredDescription
bodyUrlCategoriesGetCategoriesWithMatchingDomainsRequestBodyYes-

Returns: UrlDomainReview

Example:

resource = session.zia.UrlCategory()
result = resource.add_url_categories_with_matching_domains(body=["value"])
print(result)

create()​

Creates a new UrlCategory. Set properties on the resource instance, then call create() — this method takes no arguments.

Properties for creation:

NameTypeRequiredDescription
category_scopestringNo-
configured_namestringNo-
custom_categorybooleanNo-
custom_ip_ranges_countintegerNo-
custom_urls_countintegerNo-
db_categorized_urlsstringCollectionNo-
descriptionstringNo-
editablebooleanNo-
idstringNo-
ip_rangesstringCollectionNo-
ip_ranges_retaining_parent_categorystringCollectionNo-
ip_ranges_retaining_parent_category_countintegerNo-
keywordsstringCollectionNo-
keywords_retaining_parent_categorystringCollectionNo-
regex_patternsstringCollectionNo-
regex_patterns_retaining_parent_categorystringCollectionNo-
scopesAdminScopeWrapperCollectionNo-
super_categorystringNo-
template_synced_categorybooleanNo-
typestringNo-
url_keyword_countsUrlKeywordCountsNo-
url_typestringNo-
urlsstringCollectionNo-
urls_retaining_parent_category_countintegerNo-
valintegerNo-

Returns: UrlCategory

Example:

resource = session.zia.UrlCategory()
resource.category_scope = "value"
resource.configured_name = "example-configured-name"
resource.custom_category = True
resource.create()
print(f"Created with ID: {resource.id}")

delete()​

Deletes a UrlCategory by id. Only the id identifier is required; delete() takes no other arguments.

Example:

resource = session.zia.UrlCategory(id="your-resource-id")
resource.delete()

get_url_category_max_custom_count()​

Parameters:

NameTypeRequiredDescription
groupstringYes-

Example:

resource = session.zia.UrlCategory()
result = resource.get_url_category_max_custom_count(group="value")
print(result)

get_url_category_quota()​

Returns: UrlsQuotaDOM

Example:

resource = session.zia.UrlCategory()
result = resource.get_url_category_quota()
print(result)

lookup_url_categories()​

Parameters:

NameTypeRequiredDescription
bodyUrlCategoriesUrlLookupRequestBodyYes-

Returns: UrlCategory

Example:

resource = session.zia.UrlCategory()
result = resource.lookup_url_categories(body=["value"])
print(result)

load()​

Fetches an existing UrlCategory by id. Only the id identifier is required; load() takes no other arguments.

Returns: UrlCategory

Example:

resource = session.zia.UrlCategory(id="your-resource-id")
resource.load()
print(resource.configured_name)

update()​

Updates an existing UrlCategory. Call load() first, modify properties, then call update() — this method takes no arguments.

Properties for update:

NameTypeRequiredDescription
actionstringNo-
category_scopestringNo-
configured_namestringNo-
custom_categorybooleanNo-
custom_ip_ranges_countintegerNo-
custom_urls_countintegerNo-
db_categorized_urlsstringCollectionNo-
descriptionstringNo-
editablebooleanNo-
idstringNo-
ip_rangesstringCollectionNo-
ip_ranges_retaining_parent_categorystringCollectionNo-
ip_ranges_retaining_parent_category_countintegerNo-
keywordsstringCollectionNo-
keywords_retaining_parent_categorystringCollectionNo-
regex_patternsstringCollectionNo-
regex_patterns_retaining_parent_categorystringCollectionNo-
scopesAdminScopeWrapperCollectionNo-
super_categorystringNo-
template_synced_categorybooleanNo-
typestringNo-
url_keyword_countsUrlKeywordCountsNo-
url_typestringNo-
urlsstringCollectionNo-
urls_retaining_parent_category_countintegerNo-
valintegerNo-

Returns: UrlCategory

Example:

resource = session.zia.UrlCategory(id="your-resource-id")
resource.load()
resource.configured_name = "Updated value"
resource.update()

update_url_categories_with_matching_domains()​

Parameters:

NameTypeRequiredDescription
bodyUrlCategoriesUpdateCategoriesWithMatchingDomainsRequestBodyYes-

Example:

resource = session.zia.UrlCategory()
result = resource.update_url_categories_with_matching_domains(body=[{"domain_type": "value", "matches": [{"id": "resource-id", "name": "example-name"}], "url": "https://example.com"}])
print(result)

Attributes​

NameTypeRequiredDescription
category_scopestringNo-
configured_namestringNo-
custom_categorybooleanNo-
custom_ip_ranges_countintegerNo-
custom_urls_countintegerNo-
db_categorized_urlsstringCollectionNo-
descriptionstringNo-
editablebooleanNo-
idstringNo-
ip_rangesstringCollectionNo-
ip_ranges_retaining_parent_categorystringCollectionNo-
ip_ranges_retaining_parent_category_countintegerNo-
keywordsstringCollectionNo-
keywords_retaining_parent_categorystringCollectionNo-
regex_patternsstringCollectionNo-
regex_patterns_retaining_parent_categorystringCollectionNo-
scopesAdminScopeWrapperCollectionNo-
super_categorystringNo-
template_synced_categorybooleanNo-
typestringNo-
url_keyword_countsUrlKeywordCountsNo-
url_typestringNo-
urlsstringCollectionNo-
urls_retaining_parent_category_countintegerNo-
valintegerNo-
actionstringNo-