Change a member's role
PATCH
/api/orgs/{org}/members/{userId}
const url = 'https://api-dev.wrktr.com/api/orgs/example/members/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"owner"}'};
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-dev.wrktr.com/api/orgs/example/members/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "owner" }'Owners only. An organization always keeps at least one owner.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
userId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
role
required
string
Responses
Section titled “Responses”Success
Media typeapplication/json
object
ok
required
boolean
Examplegenerated
{ "ok": true}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}Forbidden
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Forbidden"}OrgNotFound | NotFound
LastOwner
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "LastOwner"}