Change a member's role
PATCH
/organizations/{org_id}/members/{user_id}
const url = 'https://api.perstat.io/organizations/example/members/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.perstat.io/organizations/example/members/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "example" }'Updates an organization member’s role. The caller needs member management rights, may not modify members above their own level nor assign a role beyond it, and demoting the last owner is rejected with 409. Unknown role values return 400. The change is audit-logged.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org_id
required
string
user_id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
role
required
string
Examplegenerated
{ "role": "example"}