Iterate through paginated results
masterPaginated requests return a SyncPager or AsyncPager. You can iterate through the items directly as a generator, or use .iter_pages() to navigate page-by-page. When using .iter_pages(), you can access the typed response for each page via the .response attribute.
from auth0.management import Auth0
client = Auth0(
base_url="https://YOUR_TENANT.auth0.com/api/v2",
token="YOUR_TOKEN",
)
# Get a pager object
response = client.actions.list(
trigger_id="post-login",
action_name="actionName",
deployed=True,
page=1,
per_page=1,
installed=True,
)
# Option 1: Iterate through all items directly
for item in response:
print(item)
# Option 2: Paginate page-by-page
for page in response.iter_pages():
print(page)
# Option 3: Access typed response per page
pager = client.actions.list(...)
for page in pager.iter_pages():
print(page.response) # access the typed response for each page
for item in page:
print(item)