Skip to main content

User

User 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 User
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 User
resource = session.zia.User(id="your-resource-id")
resource.load()
print(resource)

# Debug output shows HTTP request/response details

Identifiers​

NameTypeDescription
idstringUnique identifier

Actions​

bulk_delete_user()​

Parameters:

NameTypeRequiredDescription
idsint32CollectionNo-

Returns: IdListInteger

Example:

resource = session.zia.User()
result = resource.bulk_delete_user()
print(result)

create()​

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

Properties for creation:

NameTypeRequiredDescription
admin_userbooleanNo-
commentsstringNo-
deletedbooleanNo-
departmentDepartmentNo-
disabledbooleanNo-
emailstringNo-
groupsGroupWrapperCollectionNo-
idintegerNo-
is_non_editablebooleanNo-
namestringNo-
passwordstringNo-
pilot_userbooleanNo-
pwd_last_modified_timeintegerNo-
system_defined_groupsGroupWrapperCollectionNo-
temp_auth_emailstringNo-
typestringNo-
user_risk_scoreUserRiskScoreNo-

Returns: User

Example:

resource = session.zia.User()
resource.admin_user = True
resource.comments = "value"
resource.deleted = True
resource.create()
print(f"Created with ID: {resource.id}")

delete()​

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

Example:

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

load()​

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

Returns: User

Example:

resource = session.zia.User(id="your-resource-id")
resource.load()
print(resource.name)

update()​

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

Properties for update:

NameTypeRequiredDescription
admin_userbooleanNo-
commentsstringNo-
deletedbooleanNo-
departmentDepartmentNo-
disabledbooleanNo-
emailstringNo-
groupsGroupWrapperCollectionNo-
idintegerYes-
is_non_editablebooleanNo-
namestringNo-
passwordstringNo-
pilot_userbooleanNo-
pwd_last_modified_timeintegerNo-
system_defined_groupsGroupWrapperCollectionNo-
temp_auth_emailstringNo-
typestringNo-
user_risk_scoreUserRiskScoreNo-

Returns: User

Example:

resource = session.zia.User(id="your-resource-id")
resource.load()
resource.name = "Updated value"
resource.update()

enroll_user_auth()​

Parameters:

NameTypeRequiredDescription
auth_methodsAuthMethodsEnumCollectionNo-
passwordstringNo-

Example:

resource = session.zia.User(id="your-resource-id")
result = resource.enroll_user_auth()
print(result)

Attributes​

NameTypeRequiredDescription
admin_userbooleanNo-
commentsstringNo-
deletedbooleanNo-
departmentDepartmentNo-
disabledbooleanNo-
emailstringNo-
groupsGroupWrapperCollectionNo-
idintegerNo-
is_non_editablebooleanNo-
namestringNo-
passwordstringNo-
pilot_userbooleanNo-
pwd_last_modified_timeintegerNo-
system_defined_groupsGroupWrapperCollectionNo-
temp_auth_emailstringNo-
typestringNo-
user_risk_scoreUserRiskScoreNo-
  • User - Data structure definition
  • Logging guide - enable verbose logs while debugging this resource