Skip to content
API Reference

List policy sets in a zone

zones.policy_sets.list(strzone_id, PolicySetListParams**kwargs) -> PolicySetListResponse
GET/zones/{zone_id}/policy-sets

List policy sets in a zone

ParametersExpand Collapse
zone_id: str
after: Optional[str]

Return items after this cursor (forward pagination). Use after_cursor from a previous response. Mutually exclusive with before.

before: Optional[str]

Return items before this cursor (backward pagination). Use before_cursor from a previous response. Mutually exclusive with after.

expand: Optional[List[Literal["total_count"]]]

Opt-in to additional response fields

limit: Optional[int]

Maximum number of items to return

maximum100
minimum1
order: Optional[Literal["asc", "desc"]]

Sort direction. Default is desc (newest first).

Accepts one of the following:
"asc"
"desc"
sort: Optional[Literal["created_at"]]

Field to sort by.

x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class PolicySetListResponse:
active: Optional[bool]

Whether this policy set is currently bound to a scope

active_version: Optional[int]

Human-readable version number of the active version (e.g., 1, 2, 3)

active_version_id: Optional[str]

Public ID of the currently active (bound) version

mode: Optional[Literal["active", "shadow"]]
Accepts one of the following:
"active"
"shadow"
scope_target_id: Optional[str]

List policy sets in a zone

from keycardai_api import KeycardAPI

client = KeycardAPI()
policy_sets = client.zones.policy_sets.list(
    zone_id="zone_id",
)
print(policy_sets.items)
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "name": "name",
      "owner_type": "platform",
      "scope_type": "zone",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "latest_version": 0,
      "latest_version_id": "latest_version_id",
      "updated_by": "updated_by",
      "active": true,
      "active_version": 0,
      "active_version_id": "active_version_id",
      "mode": "active",
      "scope_target_id": "scope_target_id"
    }
  ],
  "pagination": {
    "after_cursor": "after_cursor",
    "before_cursor": "before_cursor",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "name": "name",
      "owner_type": "platform",
      "scope_type": "zone",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "latest_version": 0,
      "latest_version_id": "latest_version_id",
      "updated_by": "updated_by",
      "active": true,
      "active_version": 0,
      "active_version_id": "active_version_id",
      "mode": "active",
      "scope_target_id": "scope_target_id"
    }
  ],
  "pagination": {
    "after_cursor": "after_cursor",
    "before_cursor": "before_cursor",
    "total_count": 0
  }
}