User
User resource for Zscaler Internet Access.
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
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier |
Actions
bulk_delete_user()
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
ids | int32Collection | No | - |
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:
| Name | Type | Required | Description |
|---|---|---|---|
admin_user | boolean | No | - |
comments | string | No | - |
deleted | boolean | No | - |
department | Department | No | - |
disabled | boolean | No | - |
email | string | No | - |
groups | GroupWrapperCollection | No | - |
id | integer | No | - |
is_non_editable | boolean | No | - |
name | string | No | - |
password | string | No | - |
pilot_user | boolean | No | - |
pwd_last_modified_time | integer | No | - |
system_defined_groups | GroupWrapperCollection | No | - |
temp_auth_email | string | No | - |
type | string | No | - |
user_risk_score | UserRiskScore | No | - |
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:
| Name | Type | Required | Description |
|---|---|---|---|
admin_user | boolean | No | - |
comments | string | No | - |
deleted | boolean | No | - |
department | Department | No | - |
disabled | boolean | No | - |
email | string | No | - |
groups | GroupWrapperCollection | No | - |
id | integer | Yes | - |
is_non_editable | boolean | No | - |
name | string | No | - |
password | string | No | - |
pilot_user | boolean | No | - |
pwd_last_modified_time | integer | No | - |
system_defined_groups | GroupWrapperCollection | No | - |
temp_auth_email | string | No | - |
type | string | No | - |
user_risk_score | UserRiskScore | No | - |
Returns: User
Example:
resource = session.zia.User(id="your-resource-id")
resource.load()
resource.name = "Updated value"
resource.update()
enroll_user_auth()
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
auth_methods | AuthMethodsEnumCollection | No | - |
password | string | No | - |
Example:
resource = session.zia.User(id="your-resource-id")
result = resource.enroll_user_auth()
print(result)
Attributes
| Name | Type | Required | Description |
|---|---|---|---|
admin_user | boolean | No | - |
comments | string | No | - |
deleted | boolean | No | - |
department | Department | No | - |
disabled | boolean | No | - |
email | string | No | - |
groups | GroupWrapperCollection | No | - |
id | integer | No | - |
is_non_editable | boolean | No | - |
name | string | No | - |
password | string | No | - |
pilot_user | boolean | No | - |
pwd_last_modified_time | integer | No | - |
system_defined_groups | GroupWrapperCollection | No | - |
temp_auth_email | string | No | - |
type | string | No | - |
user_risk_score | UserRiskScore | No | - |
Related
- User - Data structure definition
- Logging guide - enable verbose logs while debugging this resource