v1

latestOpenAPI 3.1.0MIT2026-07-243952451019.0 KB
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

idinteger

Publish Action ID

public_idstring nullable

Publish Action public ID

course_idinteger

ID of the course whose sections are being published

target_allboolean nullable

When true every section of the course is targeted for publishing. Mutually exclusive with target_ids.

target_idsinteger[] nullable

Explicit list of raw (integer) course-section IDs targeted for publishing. The response echoes the raw stored IDs (the create request accepts public IDs, which are decoded on input). Mutually exclusive with target_all.

auto_enrollboolean nullable

When true, existing course enrollees are automatically granted access to the newly published sections.

send_emailboolean nullable

When true (and auto_enroll is also true), enrolled contacts receive an email notification about the newly published sections.

offer_new_section_via_all_access_productsboolean nullable

When true, products that grant full course access are updated to also offer the newly published sections.

target_countinteger nullable

Total number of sections targeted by this action. null until the async job has resolved the count.

performed_countinteger nullable

Number of sections processed so far. Poll alongside target_count to track async progress.

scheduled_forstring date-time nullable

When set, the action is deferred until this datetime. Must be a future datetime. null means execute immediately.

started_atstring date-time nullable

Datetime the async job began processing sections. null until started.

completed_atstring date-time nullable

Datetime the async job finished. null until complete.

created_by_idinteger nullable

ID of the workspace membership that created this action.

approved_by_idinteger nullable

ID of the membership that approved this action (reserved for future use).

created_atstring date-time nullable

Created at datetime

updated_atstring date-time nullable

Updated at datetime

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"
}