Skip to content
Docs

Roles

Roles

List roles
zones.roles.list(strzone_id, RoleListParams**kwargs) -> RoleListResponse
GET/zones/{zoneId}/roles
Create role
zones.roles.create(strzone_id, RoleCreateParams**kwargs) -> Role
POST/zones/{zoneId}/roles
Get role
zones.roles.retrieve(strrole_id, RoleRetrieveParams**kwargs) -> Role
GET/zones/{zoneId}/roles/{roleId}
Update role
zones.roles.update(strrole_id, RoleUpdateParams**kwargs) -> Role
PATCH/zones/{zoneId}/roles/{roleId}
Delete role
zones.roles.delete(strrole_id, RoleDeleteParams**kwargs)
DELETE/zones/{zoneId}/roles/{roleId}
ModelsExpand Collapse
class Role:

A role that can be assigned to users within a zone.

id: str

Unique identifier of the role

created_at: datetime

Entity creation timestamp

formatdate-time
identifier: str

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
owner_type: Literal["platform", "customer"]

Who owns this role. Platform-owned roles are managed by Keycard and cannot be modified or deleted via the API; customer-owned roles are user-created.

Accepts one of the following:
"platform"
"customer"
updated_at: datetime

Entity update timestamp

formatdate-time
zone_id: str

Zone this role belongs to

description: Optional[str]

Human-readable description

maxLength1000
class RoleCreate:

Schema for creating a new role

identifier: str

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
description: Optional[str]

Human-readable description

maxLength1000
class RoleUpdate:

Schema for updating an existing role. The role identifier is immutable.

description: Optional[str]

Human-readable description (set to null to unset)

maxLength1000