Courses::Sections::PublishAction
Create Publish Action
Publish one or more course sections (and their lessons). Provide either target_ids (an array of course-section public IDs) or target_all: true to publish every section of the course. Returns 422 if neither is supplied. The action runs asynchronously — poll with GET /api/v2/courses/sections/publish_actions/{id} and compare performed_count to target_count to track progress. Set auto_enroll: true to grant existing course enrollees access to the newly published sections. Pair with send_email: true to notify them. Use scheduled_for (ISO 8601, must be a future datetime) to defer the publish.
post/courses/{course_id}/sections/publish_actions
Path parameters
course_idinteger required
Request body
Example request
{
"courses_sections_publish_action": {
"courses_sections_publish_action": {
"target_ids": [
"sSwcZK"
],
"auto_enroll": true,
"send_email": true
}
}
}Response
Created
Example response
{
"id": 1,
"public_id": "aB3cD4",
"course_id": 5,
"target_all": false,
"target_ids": [
8,
9
],
"auto_enroll": true,
"send_email": true,
"offer_new_section_via_all_access_products": false,
"target_count": 2,
"performed_count": 1,
"scheduled_for": null,
"started_at": "2025-01-01T00:01:00.000Z",
"completed_at": null,
"created_by_id": 3,
"approved_by_id": null,
"created_at": "2025-01-01T00:00:00.000Z",
"updated_at": "2025-01-01T00:01:00.000Z"
}