Link Search Menu Expand Document

Getting Started with the Zscaler ZPA API

For the ZPA API, you will need to provide params when initialising the class or set the environment variables.

Initialising the pyZscaler ZPA instance

All examples in this documentation will assume that you are initialising the pyZscaler ZPA Class the same way as shown below. Ensure that you make adjustments in your code if you are using a different naming convention.

from pyzscaler.zpa import ZPA
from pprint import pprint

zpa = ZPA(client_id='CLIENT_ID', client_secret='CLIENT_SECRET', customer_id='CUSTOMER_ID')

for app_segment in zpa.app_segments.list():
    pprint(app_segment)

ZPA Parameters

The table below shows the parameters that the pyZscaler ZPA Class requires.

Param ENV Description
client_id ZIA_CLIENT_ID The client ID that is associated with the client secret.
client_secret ZIA_CLIENT_SECRET The client secret that was generated for the client ID.
customer_id ZPA_CUSTOMER_ID The customer ID for the ZPA tenancy.

How to generate the API Key

See the ZPA docs for how to generate the client_id, client_secret and find the customer_id.


Table of contents