Skip to content

Enrols one existing WordPress user in the course on behalf of an administrator.

user_id is required and must reference a real user; their community profile is created on the fly if missing. Users whose profile is not active are rejected, as is a user who is already enrolled.

Endpoint

  • Method: POST

  • Path: /admin/courses/{course_id}/students

  • Edition: Core

  • Controller: CourseAdminController@addStudent

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

  • 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 Add Course Student

POST
/admin/courses/{course_id}/students

Enrols one existing WordPress user in the course on behalf of an administrator.

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

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

Request Body

application/json
JSON
{
  
"user_id": "string"
}

Responses

Successful response

application/json
JSON
{
  
"message": "string"
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation