Add a user to one or more groups.
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
URL Parameters
Request Body
Array of group IDs to add the user to
Response
Array of groups the user was added to
Number of assigned courses
Error Responses
Validation error responseShow Error object properties
Not Found error responseShow Error object properties
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/1234567890/groups' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"groups": [1, 2, 3]
}'
{
"groups": [
{
"id": 1,
"parentId": null,
"name": "Sales Team",
"usersCount": 15,
"coursesCount": 5,
"image": null,
"attributes": {}
},
{
"id": 2,
"parentId": 1,
"name": "Regional Sales",
"usersCount": 8,
"coursesCount": 3,
"image": null,
"attributes": {}
}
]
}