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. Accepts API keys with the org:write scope, subject to current role and resource grants.
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"}Responses
Section titled “Responses”Request succeeded. The response has no body.
The request is invalid. Check the supplied fields and values.
Authentication is missing or invalid.
The authenticated caller does not have permission to perform this operation.
No accessible resource matches the supplied identifier.
The request conflicts with the current resource state.