Skip to content

Enrols the current user in a course and returns their freshly initialised progress track.

Self-enrolment only works on published, public courses; course admins may enrol themselves in their own unpublished courses. Calling it again on an existing enrolment is not an error — it returns the current track with an already-enrolled message.

Endpoint

  • Method: POST

  • Path: /courses/{course_id}/enroll

  • Edition: Core

  • Controller: CourseController@enrollCourse

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

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

  • Requires a signed-in user; private and secret courses must be joined through an admin or a paywall.

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 Enroll Course

POST
/courses/{course_id}/enroll

Enrols the current user in a course and returns their freshly initialised progress track.

Controller: CourseController@enrollCourse
Route source: fluent-community/Modules/Course/Http/course_api.php:14

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

Responses

Successful response

application/json
JSON
{
  
"message": "string",
  
"track": {
  
  
"completed_lessons": [
  
  
  
{
  
  
  
  
"additionalProperties": "string"
  
  
  
}
  
  
],
  
  
"isEnrolled": true,
  
  
"progress": 0
  
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation