---
title: "Create Publish Action"
method: POST
path: "/courses/{course_id}/sections/publish_actions"
tags: ["Courses::Sections::PublishAction"]
---

# Create Publish Action

`POST /courses/{course_id}/sections/publish_actions`

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.

## Path parameters

- `course_id` integer, required

## Request body

- object
  - `courses_sections_publish_action` CoursesSectionsPublishActionParameters — Parameters for creating a course-section publish action
    - `target_all` boolean — Set to `true` to publish every section of the course. Mutually exclusive with `target_ids`. Exactly one of `target_all` or `target_ids` must be supplied.
    - `target_ids` string[] — Array of course-section public IDs to publish. Mutually exclusive with `target_all`. Exactly one of `target_ids` or `target_all` must be supplied.
    - `auto_enroll` boolean — When `true`, existing course enrollees are granted access to the newly published sections automatically.
    - `send_email` boolean — When `true` (requires `auto_enroll: true`), enrolled contacts receive an email notification about the newly published sections.
    - `offer_new_section_via_all_access_products` boolean — When `true`, products that grant full course access are updated to also include the newly published sections.
    - `scheduled_for` string, date-time — Optional ISO 8601 datetime. The publish is deferred until this time. Must be a future datetime. Omit to publish immediately.

## Response `201`

Created

- CoursesSectionsPublishActionAttributes — Asynchronous action that publishes one or more course sections and their lessons
  - `id` integer — Publish Action ID
  - `public_id` string, nullable — Publish Action public ID
  - `course_id` integer — ID of the course whose sections are being published
  - `target_all` boolean, nullable — When `true` every section of the course is targeted for publishing. Mutually exclusive with `target_ids`.
  - `target_ids` integer[], 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_enroll` boolean, nullable — When `true`, existing course enrollees are automatically granted access to the newly published sections.
  - `send_email` boolean, 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_products` boolean, nullable — When `true`, products that grant full course access are updated to also offer the newly published sections.
  - `target_count` integer, nullable — Total number of sections targeted by this action. `null` until the async job has resolved the count.
  - `performed_count` integer, nullable — Number of sections processed so far. Poll alongside `target_count` to track async progress.
  - `scheduled_for` string, date-time, nullable — When set, the action is deferred until this datetime. Must be a future datetime. `null` means execute immediately.
  - `started_at` string, date-time, nullable — Datetime the async job began processing sections. `null` until started.
  - `completed_at` string, date-time, nullable — Datetime the async job finished. `null` until complete.
  - `created_by_id` integer, nullable — ID of the workspace membership that created this action.
  - `approved_by_id` integer, nullable — ID of the membership that approved this action (reserved for future use).
  - `created_at` string, date-time, nullable — Created at datetime
  - `updated_at` string, date-time, nullable — Updated at datetime

## Other responses

- `401` — Unauthorized
- `422` — Unprocessable Entity — neither `target_ids` nor `target_all` was supplied; or `scheduled_for` is not a valid future datetime.

---

[API](https://skmtc.net/myclickfunnels/apis/clickfunnels-api.md) · [All operations](https://skmtc.net/myclickfunnels/apis/clickfunnels-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myclickfunnels/clickfunnels-api/revisions/ae6313eaa176/schema)
