RAID API
  1. Free Learnings
  • DiveRAID frontend public API
    • Search divers
      POST
    • Search instructors
      POST
    • Search dive centers
      POST
    • Search dive centers by country
      GET
  • DiveRAID rest API V1
    • Auth
      • Register a new user
      • Login and get a Sanctum token
      • Send password reset email
      • Reset password using token
      • Logout and revoke the current token
      • Resend email verification
      • Complete a two-factor login and get a Sanctum token
    • Profile
      • The user resource
      • Get authenticated user profile
      • Update profile
      • Register push token
      • Update password
      • Remove push token
      • Rotate exam unlock code
      • Delete account
      • Update dive center association
    • Diver
      • Shared diver resources
      • Courses
        • List active courses
        • Get exam result
        • Submit course exam
        • Sign skills (diver)
        • Get course detail
        • Submit module quiz
        • List expired courses
        • Get quiz result
        • Get skills progress
      • Free Learnings
        • List enrolled free learnings
          GET
        • Get free learning quiz result
          GET
        • List available free learning courses
          GET
        • Submit free learning module quiz
          POST
        • Get free learning detail
          GET
        • Enroll in a free learning course
          POST
      • Certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
        • List diver certifications
      • Dive Logs
        • Delete dive log
        • Create dive log
        • Update dive log
        • List loggable courses
        • List dive logs (paginated)
        • Get dive log
      • Awards
        • List the recognition cards issued to the user
      • Documents
        • Upload own medical certificate or insurance
        • List own medical certificates and insurance
        • List diver documents
      • Forms
        • List diver forms
      • Medical
        • Get medical questionnaire structure
        • Submit medical questionnaire
      • Store
        • List courses available for purchase
        • Get order status
    • Professional
      • Students
        • List students
        • Get student progress
        • Sign student skills
        • Get student exam result
        • Get student quiz result
        • Get student skills progress
      • Certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
        • List all professional certifications
        • List diver-level certifications
        • List examiner certifications
        • List professional certifications
        • List specialty certifications
        • List trainer certifications
      • Classroom
        • List classrooms
        • Get classroom progress (all students)
        • Get classroom student progress
        • Sign classroom student skills
        • Get classroom student exam result
        • Get classroom student quiz result
        • Get classroom student skills
      • Renewals
        • List renewal courses
        • Get renewal exam result
        • Submit renewal exam
        • Sign renewal skills
        • Renewal status
        • Get renewal progress
        • Submit renewal module quiz
        • Get renewal quiz result
        • Get renewal skills progress
      • Dive Logs
        • Get student dive log
        • Sign student dive log
        • List student dive logs for a course
    • Sync
      • Download full course data for offline use
      • Upload offline operations
      • Get sync status
    • Public
      • List all countries
      • Dive-log enum values with labels in the response language
      • Get country data
      • Get country divisions (states/provinces)
      • List time zone identifiers, optionally narrowed to one country
      • List, search, and radius-search publicly visible dive centres
      • Every publicly visible, geolocated dive centre as a map marker
      • Countries with at least one publicly visible dive centre
      • Full detail of one publicly visible dive centre
    • Library
      • List the RAID document library
      • List the current RAID standards
  • Schemas
    • Frontend API Schema
      • DiverSearch
    • SuccessResponse
    • DiverCertification
    • ValidationErrorResponse
    • TwoFactorChallengeResponse
    • TokenResponse
    • IssuedCertification
    • ErrorResponse
    • DiveLog
    • ExamResult
    • QuizResult
    • CourseLogDetail
    • CourseLog
    • UserProfile
    • SkillProgress
    • Certification
    • PaginatedDiveLogs
    • StoreItem
    • PaymentIntentResponse
    • OrderConfirmResponse
    • OrderStatusResponse
    • InstructorSearch
    • DiveCenterSearch
  1. Free Learnings

Enroll in a free learning course

POST
https://test.diveraid.com/api/v1/diver/free-learnings/enroll
Diver / Free Learnings
Maintainer:Not configured

Overview#

Self-enrolls the authenticated diver in a free-learning course, creating a FreeLearning record via User::enrollFreeLearning(). Served by FreeLearningController::enroll().
Controller: App\Http\Controllers\Api\V1\Diver\FreeLearningController::enroll()
Route name: api.v1.diver.free-learnings.enroll

Authentication#

Type: Bearer Token
Header: Authorization: Bearer {token}

Request#

Method: POST
Path: /api/v1/diver/free-learnings/enroll
Content-Type: application/json

Body#

{
  "course_id": 83
}
FieldTypeRequiredValidationDescription
course_idintegerYesrequired|integer|exists:courses,id (active, credit_id not null, course_type = 'course', is_renew = false, is_free_learning = true)A course listed by GET /api/v1/diver/free-learnings/available (before the exclusion of held courses). No role filter
Validated by App\Http\Requests\Api\V1\Diver\EnrollFreeLearningRequest, extends ApiFormRequest — full envelope 422.

Example request#


Response 201 Created#

Captured live.
{
  "success": true,
  "status": "success",
  "message": "Enrolled successfully",
  "data": {
    "log_code": "24c6d5ce109a0f9e0595fba33fb38947",
    "course": { "id": 83, "name": "Wreck Instructor Trainer" }
  }
}

Response fields#

FieldTypeNullableNotes
log_codestring(32)NoNewly generated, use to address this enrollment on every other free-learning endpoint
course.idintegerNo
course.namestringNo

Errors#

401 Unauthorized#

{
  "success": false,
  "status": "error",
  "message": "Unauthenticated"
}

409 Conflict - already held#

The diver already holds the course as a free learning, a course log or a certification.
Captured live.
{
  "success": false,
  "status": "error",
  "message": "Already enrolled in this course"
}

422 Unprocessable Entity — validation#

Captured live, empty body.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "course_id": ["The course id field is required."]
  }
}

Notes#

Side effects: creates a FreeLearning row via User::enrollFreeLearning().
Validation accepts only the courses of the available list: a recognition, an inactive course, a course without credit_id, a renewal course or a course with is_free_learning = false answers 422.
No race protection beyond the held-course check (available_courses_with_free_learning) immediately before the insert - TO VERIFY under concurrent requests.

Source: docs/api/diver/free-learnings/POST_enroll.md

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Enrolled
Bodyapplication/json

🟠401
🟠409
🟠422
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://test.diveraid.com/api/v1/diver/free-learnings/enroll' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "course_id": 0
}'
Response Response Example
201 - Example 1
{
    "status": "success",
    "message": "string",
    "data": {
        "log_code": "string",
        "course": {
            "id": 0,
            "name": "string"
        }
    }
}
Modified at 2026-12-04 07:58:20
Previous
Get free learning detail
Next
Get certification history
Built with