Skip to content
API Reference

Update organization user role in a zone

client.zones.members.update(stringorganizationUserID, MemberUpdateParams { zoneId, role } params, RequestOptionsoptions?): ZoneMember { id, _links, created_at, 5 more }
PATCH/zones/{zoneId}/members/{organizationUserId}

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

ParametersExpand Collapse
organizationUserID: string
params: MemberUpdateParams { zoneId, role }
zoneId: string

Path param: Zone ID

role: ZoneRole

Body param: 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
ZoneMember { id, _links, created_at, 5 more }

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

id: string

Unique identifier of the zone member

created_at: string

Entity creation timestamp

formatdate-time
organization_id: string

Organization ID that owns the zone

organization_user_id: string

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: string

Entity update timestamp

formatdate-time
zone_id: string

Zone ID the organization user is a member of

Update organization user role in a zone

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const zoneMember = await client.zones.members.update('organizationUserId', {
  zoneId: 'zoneId',
  role: 'zone_manager',
});

console.log(zoneMember.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"
}