POST
/
groups
/
{groupId}
/
users
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/groups/123/users' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"users": ["user1", "user2"]
}'
{
    "users": [
{
    "id": "user1",
    "name": "John Smith",
    "email": "john@example.com",
    "role": {
    "alias": "learner"
}
}
    ]
}
Add one or more users to a specified group.

Path Parameters

groupId
integer
required
The unique identifier of the group

Request Headers

X-API-KEY
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.

Request Body

users
array
required
Array of user IDs to add to the group

Error Responses

404
object
Returned when the group is not found
400
object
Returned when there’s a validation error (e.g., users already in group)
curl --request POST \
--url 'https://YOURSITE.konstant.ly/openapi/v1/groups/123/users' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"users": ["user1", "user2"]
}'
{
    "users": [
{
    "id": "user1",
    "name": "John Smith",
    "email": "john@example.com",
    "role": {
    "alias": "learner"
}
}
    ]
}