The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Greetings,
I would like to create a canvas course via the API and restrict course access based on the course start_date and end_date.
I can successfully create the course with start_date and end_date, however, the course isn't published and the checkbox to "Restrict students from viewing course before course start date" is not checked".
To "publish" the course, I set the "offer" parameter as true. Now when I create a course, the course is published but the "Restrict students from viewing course before course start date" is not checked" is still unchecked. Here is an example of the payload in the api request:
data: {
course: {
name,
start_at,
end_at,
license: 'private',
sis_course_id,
allow_student_forum_attachments: true,
timezone,
course_format: 'online',
restrict_enrollments_to_course_dates: true
},
enable_sis_reactivation: true,
// offer: true
}
From my understanding, when I create a course with start_date, end_date, and restrict_enrollments_to_course_dates, when the course is published, students should not be able to engage in the course until the start date. I don't know how to update this payload to reflect that behavior.
I think the restrict_enrollments_to_course_dates parameter only controls enrollments. To control viewing, I think you might have to update the course settings, in particular the restrict_student_past_view and restrict_student_future_view parameters.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in