Skip to main content

Change User Role

This endpoint allows user managers to change the role of some users in the specified course.
At least one parameter between managers, joined and unjoined is required.

note

The creator of the course cannot be removed from the managers.

info

This operation requires the course manager role.

HTTP Request

POST /api/v2/course/{id}/role/

Parameters

NameInTypeRequiredDescription
idpathintegertrueA unique integer value identifying this course
managersbodylist(integer)falseList of id of User to set as managers role
joinedbodylist(integer)falseList of id of User to force to join the course as normal users
unjoinedbodylist(integer)falseList of id of User to force to unjoin the course

Example Request

const inputBody = '{
"managers": ["integer"],
"joined": ["integer"],
"unjoined": ["integer"]
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/course/{id}/role/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
204No ContentResponse status codeNone