Update organization member roles
PATCH
/api/v1/organizations/{organizationId}/members/{userId}
const
url
=
'
https://localhost:8080/api/v1/organizations/example/members/example
'
;
const
options
= {
method:
'
PATCH
'
,
headers: {Authorization:
'
'
,
'
Content-Type
'
:
'
application/json
'
},
body:
'
{"roles":["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://localhost:8080/api/v1/organizations/example/members/example
\
--header
'
Authorization:
'
\
--header
'
Content-Type: application/json
'
\
--data
'
{ "roles": [ "example" ] }
'
Replace the roles assigned to an existing organization member
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”
organizationId
required
string
Organization ID (integer)
userId
required
string
User ID (UUID)
Request Body
Section titled “Request Body ”Updated roles
Media type
application/json
object
roles
Array
Example generated
{
"roles"
: [
"
example
"
]
}
Responses
Section titled “ Responses ”Member roles updated successfully
Media type
application/json
object
organizationId
integer
roles
Array
userId
string
Example generated
{
"organizationId"
:
1
,
"roles"
: [
"
example
"
],
"userId"
:
"
example
"
}
Invalid request
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}
Unauthorized
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}
Forbidden - requires Organization Owner role
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}
Membership not found
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}
Internal server error
Media type
application/json
object
error
string
error_description
string
Example
{
"error"
:
"
Unauthorized
"
,
"error_description"
:
"
Invalid token
"
}