Skip to content
API Reference

Update organization user role in a zone

zones.members.update(strorganization_user_id, MemberUpdateParams**kwargs) -> ZoneMember
PATCH/zones/{zoneId}/members/{organizationUserId}

Updates the role of an existing zone member. Only organization administrators can perform this action.

ParametersExpand Collapse
zone_id: str
organization_user_id: str
role: ZoneRole

Zone role type. zone_manager has full management access, zone_viewer has read-only access.

Accepts one of the following:
"zone_manager"
"zone_viewer"
ReturnsExpand Collapse
class ZoneMember:

Represents an organization user's membership in a zone with an assigned role

id: str

Unique identifier of the zone member

created_at: datetime

Entity creation timestamp

formatdate-time
organization_id: str

Organization ID that owns the zone

organization_user_id: str

Organization user ID of the zone member

role: ZoneRole

Zone role type. zone_manager has full management access, zone_viewer has read-only access.

Accepts one of the following:
"zone_manager"
"zone_viewer"
updated_at: datetime

Entity update timestamp

formatdate-time
zone_id: str

Zone ID the organization user is a member of

Update organization user role in a zone

from keycardai_api import KeycardAPI

client = KeycardAPI()
zone_member = client.zones.members.update(
    organization_user_id="organizationUserId",
    zone_id="zoneId",
    role="zone_manager",
)
print(zone_member.id)
{
  "id": "id",
  "_links": {
    "organization_user": {
      "href": "href"
    },
    "self": {
      "href": "href"
    }
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "organization_id": "organization_id",
  "organization_user_id": "organization_user_id",
  "role": "zone_manager",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id"
}
Returns Examples
{
  "id": "id",
  "_links": {
    "organization_user": {
      "href": "href"
    },
    "self": {
      "href": "href"
    }
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "organization_id": "organization_id",
  "organization_user_id": "organization_user_id",
  "role": "zone_manager",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id"
}