Courses::Sections::PublishAction

Create Publish Action

Changed on

Publish one or more course sections AND the lessons they contain. Provide exactly one of target_ids (a nonempty array of course-section public IDs) or target_all: true to publish every unpublished non-root section of the course. Explicit target IDs must identify sections in this course. Targeting the root "Primary module" container (or using target_all) expands to every unpublished non-root section. A missing or empty courses_sections_publish_action wrapper is a malformed request and returns 400; a well-formed wrapper with a missing or conflicting selection, or an invalid/cross-course target ID, returns 422. If a root or target_all request has no unpublished content to publish, the response is 200 OK with a message (not an error). The action runs asynchronously — poll with GET /api/v2/courses/sections/publish_actions/{id}. The status field is queued, scheduled, or processing while work remains and completed when it is done. Compare performed_count to target_count for section progress. published_lessons_count reports lesson publish states this action changed, excluding lessons already live. 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. See Publishing in the Courses Skill for when this bulk action is the right choice.

post/courses/{course_id}/sections/publish_actions

Request

Path parameters

course_idstring required

Request body

Response

OK — the request was valid but there was no unpublished content to publish (e.g. the root "Primary module" container was targeted on an empty or fully-published course). Nothing was published; this is not an error.

messagestring
target_countinteger
performed_countinteger
published_lessons_countinteger
status'completed'

Changes

    • breaking

      the request property became required

    • info

      for the path request parameter course_id, the type was generalized from integer to string

    • info

      added subschema #1: Publish specific sections subschema #2: Publish all sections to the request property oneOf list

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the success response with the status