> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myustadia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save Module Progress

> Save module watch progress.

Auth: portal API key + X-Learner-Email header. 404 "Not enrolled in this
course" if the header learner has no enrollment.

Request body: {completed, position_sec}. `completed` marks module_num
watched; modules can be completed in ANY order -- there is no forced
sequence, so a learner may watch module 3 before module 1 and both count.
`position_sec` is optional and only appends a video_events row (playback
telemetry); it does not itself affect completion.

Upserts module_progress (completed_at set once true, never unset by a
later completed=false call) and, when position_sec is given, appends a
video_events row. Owner-pinned; NEVER touches the billing consume/meter
path (learner playback is free).

Returns 200 {completion_pct: float}. Also lazily issues the certificate
if this progress update completes eligibility (see get_certificate).



## OpenAPI

````yaml /openapi.yaml post /api/v1/learn/courses/{course_id}/modules/{module_num}/progress
openapi: 3.1.0
info:
  title: Mahara Platform
  description: >
    AI Sales Training Course Generator, a Coursera-style platform.


    ## Authentication


    Every request must carry your API key as a Bearer token:


    `Authorization: Bearer sk_live_your_key_here`


    ## Getting an API key


    API keys are provisioned by our team. They are not self-service, so there is
    no signup page to apply on. To request access, email **sales@myustadia.com**
    and we will issue a key for your account.
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/learn/courses/{course_id}/modules/{module_num}/progress:
    post:
      tags:
        - B2B Learn
      summary: Save Module Progress
      description: >-
        Save module watch progress.


        Auth: portal API key + X-Learner-Email header. 404 "Not enrolled in this

        course" if the header learner has no enrollment.


        Request body: {completed, position_sec}. `completed` marks module_num

        watched; modules can be completed in ANY order -- there is no forced

        sequence, so a learner may watch module 3 before module 1 and both
        count.

        `position_sec` is optional and only appends a video_events row (playback

        telemetry); it does not itself affect completion.


        Upserts module_progress (completed_at set once true, never unset by a

        later completed=false call) and, when position_sec is given, appends a

        video_events row. Owner-pinned; NEVER touches the billing consume/meter

        path (learner playback is free).


        Returns 200 {completion_pct: float}. Also lazily issues the certificate

        if this progress update completes eligibility (see get_certificate).
      operationId: >-
        save_module_progress_api_v1_learn_courses__course_id__modules__module_num__progress_post
      parameters:
        - name: course_id
          in: path
          required: true
          schema:
            type: string
            title: Course Id
        - name: module_num
          in: path
          required: true
          schema:
            type: integer
            title: Module Num
        - name: X-Learner-Email
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Email
        - name: X-Learner-Sig
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Sig
        - name: X-Learner-Sig-Ts
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Sig-Ts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LearnerProgressRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LearnerProgressRequest:
      properties:
        completed:
          type: boolean
          title: Completed
          description: Mark the module complete
          default: false
        position_sec:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Position Sec
          description: Optional playback position for a video_events row
      type: object
      title: LearnerProgressRequest
      description: Body for the module-progress endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````