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

# Build or share self-paced online lesson

> Builds a Role kit's self-paced Creator online lesson (standalone HTML + SCORM 1.2) using zero model tokens, optionally minting a public `/learn/<code>` share link.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/kits/{kit}/lesson
openapi: 3.1.0
info:
  title: Enablement Studio API
  version: 1.0.0
  description: >-
    REST API v1 for Enablement Studio: inspect projects and kits, draft
    Role/Call/Critic runs, consult kit specialists, run deterministic
    learning-science audits, and publish SCORM/learner links.
  contact:
    name: Enablement Studio Support
    email: login@enablementstudio.app
    url: https://enablementstudio.ai/contact
servers:
  - url: https://enablementstudio.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Discovery
    description: Server metadata, signed-in account status, and public examples.
  - name: Library
    description: Read projects, kits, full kit documents, and deliverable exports.
  - name: Runs
    description: Start asynchronous Role, Call, and Critic drafts and poll status.
  - name: Specialists
    description: Read and message specialist agents; edits wait in Kit Review.
  - name: Learning Science
    description: Deterministic Mager, Bloom, Haladyna, and cognitive-load checks.
  - name: Delivery & Practice
    description: Online lessons, SCORM 1.2 exports, learner practice links, and results.
paths:
  /api/v1/kits/{kit}/lesson:
    post:
      tags:
        - Delivery & Practice
      summary: Build or share self-paced online lesson
      description: >-
        Builds a Role kit's self-paced Creator online lesson (standalone HTML +
        SCORM 1.2) using zero model tokens, optionally minting a public
        `/learn/<code>` share link.
      operationId: buildKitLesson
      parameters:
        - name: kit
          in: path
          required: true
          description: Positive numeric kit ID (1 to 16 digits, no leading zero).
          schema:
            type: integer
            minimum: 1
          example: 12
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LessonRequest'
            example:
              share: false
              rebuild: true
      responses:
        '200':
          description: Reused existing lesson build.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LessonResponse'
              example:
                kit_id: 12
                built: true
                lesson_id: abc123
                title: Harborline AE
                activity_count: 6
                preview_path: /kit/lesson?run=12
                downloads:
                  html: /kit/lesson?run=12&download=html
                  scorm_1_2: /kit/lesson?run=12&download=package
                shared: null
        '201':
          description: Built online lesson (and shared link if requested).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LessonResponse'
              example:
                kit_id: 12
                built: true
                lesson_id: abc123
                title: Harborline AE
                activity_count: 6
                preview_path: /kit/lesson?run=12
                downloads:
                  html: /kit/lesson?run=12&download=html
                  scorm_1_2: /kit/lesson?run=12&download=package
                shared: null
        '400':
          description: Not a Role kit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: wrong_product
                  message: Only Role kits have online lessons.
        '401':
          description: Missing, expired, or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: signed_out
                  message: Sign in to continue.
        '403':
          description: >-
            Connector disabled, Pro API key entitlement required (pro_required),
            route forbidden (connector_forbidden or api_key_forbidden), or
            consent missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: connector_forbidden
                  message: >-
                    An AI app cannot do that. Open Enablement Studio on the web
                    to do it.
        '404':
          description: Resource missing, trashed, or owned by another account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: not_found
                  message: That page is not part of the app.
        '409':
          description: No accepted objectives/activities or live share-link cap reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: lesson_empty
                  message: Accept objectives and practice activities first.
components:
  schemas:
    LessonRequest:
      type: object
      properties:
        share:
          type: boolean
          default: false
        rebuild:
          type: boolean
          default: false
    LessonResponse:
      type: object
      required:
        - kit_id
        - built
        - lesson_id
        - title
        - activity_count
        - preview_path
        - downloads
        - shared
      properties:
        kit_id:
          type: integer
        built:
          type: boolean
        lesson_id:
          type:
            - string
            - 'null'
        title:
          type: string
        activity_count:
          type: integer
        preview_path:
          type:
            - string
            - 'null'
        downloads:
          type:
            - object
            - 'null'
        shared:
          type:
            - object
            - 'null'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from OAuth 2.1 MCP sign-in, native app sign-in, or a Pro
        developer API key (`es_live_...`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.