The script is failing for me on first run with the following error:
06/20/2024 05:46:56 PM [Zscaler API] URL Category creation error: 400 Client Error: for url: https://zsapi.zscaler.net/api/v1/urlCategories
Reviewing the documentation at https://help.zscaler.com/zia/url-categories#/urlCategories-post, it seems that the id should be of type string, whereas the code currently has the value 0. The corresponding string is "ANY".
Editing the payload JSON to use the string value allows the script to run to completion.