Update user roles
PATCH
/domains/{domainID}/users/{userID}/roles
const url = 'https://example.com/api/v1/domains/1/users/1/roles';const options = { method: 'PATCH', headers: { cookie: 'grommunioAuthJwt=<grommunioAuthJwt>', 'Content-Type': 'application/json' }, body: '{"roles":[1]}'};
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://example.com/api/v1/domains/1/users/1/roles \ --header 'Content-Type: application/json' \ --cookie grommunioAuthJwt=<grommunioAuthJwt> \ --data '{ "roles": [ 1 ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”domainID
required
integer
ID of the domain
userID
required
integer
ID of the user
Header Parameters
Section titled “Header Parameters”X-Csrf-Token
string
CSRF Token
Request Body
Section titled “Request Body”Media typeapplication/json
object
roles
List of role IDs the user is associated with
Array<integer>
Examplegenerated
{ "roles": [ 1 ]}Responses
Section titled “ Responses ”Role association updated
Media typeapplication/json
object
data
List of role references
Array<object>
object
ID
ID of the role
integer
name
Name of the role
string
Examplegenerated
{ "data": [ { "ID": 1, "name": "example" } ]}Validation of input parameters failed
Media typeapplication/json
object
message
string
errors
List of errors encountered during validation
Array<string>
Examplegenerated
{ "message": "example", "errors": [ "example" ]}The requested resource could not be found
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}An error occurred while processing the request
Media typeapplication/json
object
message
String representation of the exception
string
Examplegenerated
{ "message": "example"}The database query failed
Media typeapplication/json
object
message
Description of the error
string
Examplegenerated
{ "message": "example"}