POST
/
courses
/
{courseId}
/
assignments
curl --request POST \
--url https://YOURSITE.konstant.ly/openapi/v1/courses/123/assignments \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"users": [1, 2, 3],
"groups": [4, 5],
"assignAt": 1676937600,
"deadlineAt": 1677024000
}'
{
    "users": [
{
    "id": "1234567890",
    "name": "John Doe",
    "email": "john@example.com",
    "role": {
    "alias": "learner"
}
}
    ],
    "groups": [
{
    "id": 4,
    "name": "Sales Team",
    "usersCount": 10,
    "coursesCount": 5
}
    ]
}

Assign a course to specific users and/or groups.

Path Parameters

courseId
integer
required

The unique identifier of the course

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

Array of user IDs to assign the course to

groups
array

Array of group IDs to assign the course to

assignAt
integer

Timestamp of date and time (UTC) when the course should be assigned

deadlineAt
integer

Timestamp of date and time (UTC) of the deadline for course completion

Response

users
array
required

Users the course was successfully assigned to

groups
array
required

Groups the course was successfully assigned to

Error Responses

404
object

Returned when the course is not found

curl --request POST \
--url https://YOURSITE.konstant.ly/openapi/v1/courses/123/assignments \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv' \
--header 'Content-Type: application/json' \
--data '{
"users": [1, 2, 3],
"groups": [4, 5],
"assignAt": 1676937600,
"deadlineAt": 1677024000
}'
{
    "users": [
{
    "id": "1234567890",
    "name": "John Doe",
    "email": "john@example.com",
    "role": {
    "alias": "learner"
}
}
    ],
    "groups": [
{
    "id": 4,
    "name": "Sales Team",
    "usersCount": 10,
    "coursesCount": 5
}
    ]
}