Skip to content

Copies a lesson, inserts the copy directly after the original and renumbers the rest of the section.

The copy takes a "(Copy)" suffix, incremented if that title is already used in the section, and gets a fresh slug. Attached documents are copied too. Every sibling lesson is renumbered so the new ordering is contiguous.

Endpoint

  • Method: POST

  • Path: /admin/courses/{course_id}/lessons/{lesson_id}/duplicate

  • Edition: Core

  • Controller: CourseAdminController@duplicateLesson

  • Route source: fluent-community/Modules/Course/Http/course_api.php:60

  • Controller source: fluent-community/Modules/Course/Http/Controllers/CourseAdminController.php

  • Requires a course admin for this course, or a WordPress user with manage_options.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Post Duplicate Lesson

POST
/admin/courses/{course_id}/lessons/{lesson_id}/duplicate

Copies a lesson, inserts the copy directly after the original and renumbers the rest of the section.

Controller: CourseAdminController@duplicateLesson
Route source: fluent-community/Modules/Course/Http/course_api.php:60

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Path Parameters

course_id*

Course ID extracted from the URL path.

Type
integer
Required
lesson_id*

Lesson ID extracted from the URL path.

Type
integer
Required

Responses

Successful response

application/json
JSON
{
  
"lesson": {
  
  
"comments_count": 0,
  
  
"content_type": "string",
  
  
"created_at": "string",
  
  
"expired_at": "string",
  
  
"featured_image": "string",
  
  
"id": 0,
  
  
"is_sticky": "string",
  
  
"message": "string",
  
  
"message_rendered": "string",
  
  
"meta": {
  
  
  
"document_lists": [
  
  
  
  
{
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"enable_comments": "string",
  
  
  
"enable_media": "string",
  
  
  
"media": {
  
  
  
  
"content_type": "string",
  
  
  
  
"html": "string",
  
  
  
  
"type": "string",
  
  
  
  
"url": "string"
  
  
  
}
  
  
},
  
  
"parent_id": "string",
  
  
"priority": "string",
  
  
"privacy": "string",
  
  
"reactions_count": 0,
  
  
"scheduled_at": "string",
  
  
"slug": "string",
  
  
"space_id": "string",
  
  
"status": "string",
  
  
"title": "string",
  
  
"type": "string",
  
  
"updated_at": "string",
  
  
"user_id": "string"
  
},
  
"message": "string"
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation