Skip to content
Docs

Roles

Roles

List roles
client.Zones.Roles.List(ctx, zoneID, query) (*ZoneRoleListResponse, error)
GET/zones/{zoneId}/roles
Create role
client.Zones.Roles.New(ctx, zoneID, body) (*Role, error)
POST/zones/{zoneId}/roles
Get role
client.Zones.Roles.Get(ctx, roleID, query) (*Role, error)
GET/zones/{zoneId}/roles/{roleId}
Update role
client.Zones.Roles.Update(ctx, roleID, params) (*Role, error)
PATCH/zones/{zoneId}/roles/{roleId}
Delete role
client.Zones.Roles.Delete(ctx, roleID, body) error
DELETE/zones/{zoneId}/roles/{roleId}
ModelsExpand Collapse
type Role struct{…}

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

ID string

Unique identifier of the role

CreatedAt Time

Entity creation timestamp

formatdate-time
Identifier string

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
OwnerType RoleOwnerType

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:
const RoleOwnerTypePlatform RoleOwnerType = "platform"
const RoleOwnerTypeCustomer RoleOwnerType = "customer"
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this role belongs to

Description stringoptional

Human-readable description

maxLength1000
type RoleCreate struct{…}

Schema for creating a new role

Identifier string

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 stringoptional

Human-readable description

maxLength1000
type RoleUpdate struct{…}

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

Description stringoptional

Human-readable description (set to null to unset)

maxLength1000