Skip to main content

Authentication Service SDK

This article outlines the Zscaler Python SDK resources you can use to manage Authentication Service features programmatically, with code examples.

Quick Start​

import zssdk

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

# Access Authentication Service service
zid = session.zid

Available Resources​

Access individual resources using the has pattern:

ResourceDescription
ApiClientApi Client resource
ResourceServerResource Server resource
GroupProfileGroup Profile resource
UserProfileUser Profile resource

Collections​

List resources using the hasMany pattern:

CollectionResource Type
api_clientsApiClient
resource_serversResourceServer
group_profilesGroupProfile
user_profilesUserProfile

Example: CRUD Operations​

import zssdk

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

# Create
resource = session.zid.ApiClient()
resource.name = "value"
resource.create()

# Read
resource = session.zid.ApiClient(id=resource.id)
resource.load()
print(resource.name)

# Update
resource.name = "Updated value"
resource.update()

# Delete
resource.delete()

Example: List Resources​

# List all resources
for item in session.zid.api_clients():
print(f"{item.id}: {item.name}")