Payezydevelopers
Sandbox

API reference / Organizations and teams

Change a member's role or status

PATCH/v1/orgs/{orgId}/members/{userId}

Assigns a different role, or disables or re-enables a member. Nobody can assign a role ranked above their own.

Before you call it

  • Permissionmembers:manage
  • Second factorRequired for browser sessions. An API key with the scope replaces it.

Parameters

ParameterWhat it does
orgIdpath, uuidrequiredThe organization the call acts on. For platform calls, your platform's id; for customer calls, the customer's organization id. Get them from getMe or the customer list.
userIdpath, uuidrequiredA member's user id from the member list.

Request body

FieldWhat it does
role_keystringNo description in the spec yet.
statusenumNo description in the spec yet.

One of active disabled

Response 200

Updated member

FieldWhat it does
user_idstring (uuid)requiredNo description in the spec yet.
emailstringrequiredNo description in the spec yet.
first_namestringrequiredNo description in the spec yet.
last_namestringrequiredNo description in the spec yet.
role_keystringrequiredNo description in the spec yet.
role_namestringrequiredNo description in the spec yet.
statusenumrequiredNo description in the spec yet.

One of active disabled

joined_atstring (date-time)requiredNo description in the spec yet.

Errors to handle

CodeWhat it means and what to do
insufficient_rank403You tried to assign, invite or revoke a role ranked above your own.

Ask a member with a higher role, usually the owner.

last_owner409an organization must keep at least one owner
cannot_disable_self422you cannot disable your own access
unknown_role422unknown role
role_not_applicable422this role is not available for this account type

Every error is a Problem document. Branch on code; quote request_id to support.