ApiKeyDetail
Api Key Detail resource for Zscaler Private Access.
Resource operations
This resource supports the following standard methods: load(), 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 ApiKeyDetail
logging.getLogger('zssdk.zpa').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 ApiKeyDetail
resource = session.zpa.ApiKeyDetail(id="your-resource-id")
resource.load()
print(resource)
# Debug output shows HTTP request/response details
Identifiers
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier |
Actions
create_api_key()
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | long | No | - |
microtenant_id | long | No | - |
id | long | No | - |
modified_time | integer | No | - |
creation_time | integer | No | - |
modified_by | long | No | - |
name | string | Yes | - |
microtenant_name | string | No | - |
restriction_type | string | No | - |
client_id | string | No | - |
client_secret | string | No | - |
enabled | boolean | No | - |
token_expiry_time_in_sec | integer | No | - |
role_id | long | No | - |
pin_session_enabled | boolean | No | - |
is_locked | boolean | No | - |
sync_version | long | No | - |
iam_client_id | string | No | - |
read_only | boolean | No | - |
zscaler_managed | boolean | No | - |
name_without_trim | string | No | - |
Example:
resource = session.zpa.ApiKeyDetail()
result = resource.create_api_key(name="example-name")
print(result)
delete()
Deletes a ApiKeyDetail by id. Only the id identifier is required; delete() takes no other arguments.
Example:
resource = session.zpa.ApiKeyDetail(id="your-resource-id")
resource.delete()
load()
Fetches an existing ApiKeyDetail by id. Only the id identifier is required; load() takes no other arguments.
Returns: ApiKeyDetail
Example:
resource = session.zpa.ApiKeyDetail(id="your-resource-id")
resource.load()
print(resource.name)
update_api_key()
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | long | No | - |
microtenant_id | long | No | - |
id | long | No | - |
modified_time | integer | No | - |
creation_time | integer | No | - |
modified_by | long | No | - |
name | string | Yes | - |
microtenant_name | string | No | - |
restriction_type | string | No | - |
client_id | string | No | - |
client_secret | string | No | - |
enabled | boolean | No | - |
token_expiry_time_in_sec | integer | No | - |
role_id | long | No | - |
pin_session_enabled | boolean | No | - |
is_locked | boolean | No | - |
sync_version | long | No | - |
iam_client_id | string | No | - |
read_only | boolean | No | - |
zscaler_managed | boolean | No | - |
name_without_trim | string | No | - |
Example:
resource = session.zpa.ApiKeyDetail(id="your-resource-id")
result = resource.update_api_key(name="example-name")
print(result)
Attributes
| Name | Type | Required | Description |
|---|---|---|---|
modified_time | integer | No | - |
creation_time | integer | No | - |
modified_by | string | No | - |
id | string | No | - |
microtenant_id | long | No | - |
microtenant_name | string | No | - |
restriction_type | string | No | - |
client_id | string | No | - |
name | string | No | - |
client_secret | string | No | - |
token_expiry_time_in_sec | integer | No | - |
enabled | boolean | No | - |
pin_session_enabled | boolean | No | - |
is_locked | boolean | No | - |
sync_version | long | No | - |
iam_client_id | string | No | - |
delivery_tag | long | No | - |
customer_id | string | No | - |
operation_type | string | No | - |
role_id | long | No | - |
read_only | boolean | No | - |
zscaler_managed | boolean | No | - |
Related
- ApiKeyDetail - Data structure definition
- Logging guide - enable verbose logs while debugging this resource