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

# Post apiv1courses templateapply



## OpenAPI

````yaml /api/openapi.json post /api/v1/courses/{courseId}/template/apply
openapi: 3.1.0
info:
  title: Tessera API
  version: '1'
servers:
  - url: https://tessera.edstratumlabs.ai
    description: Production
security: []
paths:
  /api/v1/courses/{courseId}/template/apply:
    post:
      tags:
        - courses
      operationId: applyTemplate
      parameters:
        - name: courseId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateId:
                  type: string
                  minLength: 1
                hash:
                  type: string
                  minLength: 1
              required:
                - hash
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseOutline'
        '400':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '401':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '403':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '409':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '429':
          description: API error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
      security:
        - bearerAuth: []
components:
  schemas:
    CourseOutline:
      type: object
      properties:
        course:
          $ref: '#/components/schemas/CourseSummary'
        modules:
          type: array
          items:
            $ref: '#/components/schemas/ModuleWithLessons'
      required:
        - course
        - modules
      additionalProperties: false
    ApiErrorBody:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthenticated
                - forbidden
                - not-found
                - invalid
                - conflict
                - not-ready
                - ai-disabled
                - ai-failed
                - rate-limited
                - too-large
                - unsupported
            message:
              type: string
            details: {}
    CourseSummary:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        code:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        term:
          type: string
          minLength: 1
        description:
          type: string
        welcome:
          type: string
        outcomes:
          type: array
          items:
            type: string
            minLength: 1
        instructorIds:
          type: array
          items:
            type: string
            minLength: 1
        status:
          type: string
          enum:
            - active
            - archived
        programId:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        instructorNames:
          type: array
          items:
            type: string
            minLength: 1
        moduleCount:
          type: number
          minimum: 0
        lessonCount:
          type: number
          minimum: 0
        publishedLessonCount:
          type: number
          minimum: 0
        studentCount:
          type: number
          minimum: 0
        progress:
          anyOf:
            - type: number
              minimum: 0
              maximum: 1
            - type: 'null'
        startedLessonCount:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
        program:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                accent:
                  anyOf:
                    - $ref: '#/components/schemas/Accent'
                    - type: 'null'
              required:
                - id
                - name
                - accent
              additionalProperties: false
            - type: 'null'
      required:
        - id
        - code
        - title
        - term
        - description
        - welcome
        - outcomes
        - instructorIds
        - status
        - instructorNames
        - moduleCount
        - lessonCount
        - publishedLessonCount
        - studentCount
        - progress
        - startedLessonCount
      additionalProperties: false
    ModuleWithLessons:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        courseId:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        position:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        objective:
          type:
            - string
            - 'null'
        templateKey:
          type:
            - string
            - 'null'
        lessons:
          type: array
          items:
            $ref: '#/components/schemas/LessonSummary'
      required:
        - id
        - courseId
        - title
        - position
        - lessons
      additionalProperties: false
    Accent:
      type: string
      enum:
        - teal
        - blue
        - plum
        - rust
    LessonSummary:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        moduleId:
          type: string
          minLength: 1
        courseId:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        minutes:
          type: integer
          minimum: 1
          maximum: 240
        position:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        status:
          type: string
          enum:
            - draft
            - published
        publishedAt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        templateKey:
          type:
            - string
            - 'null'
        variantOf:
          anyOf:
            - type: object
              properties:
                lessonId:
                  type: string
                  minLength: 1
                audience:
                  $ref: '#/components/schemas/VariantAudience'
                syncedAt:
                  type: string
                  minLength: 1
              required:
                - lessonId
                - audience
                - syncedAt
              additionalProperties: false
            - type: 'null'
        progress:
          anyOf:
            - type: string
              enum:
                - not-started
                - in-progress
                - completed
            - type: 'null'
        draftBlockCount:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
      required:
        - id
        - moduleId
        - courseId
        - title
        - minutes
        - position
        - status
        - publishedAt
        - progress
        - draftBlockCount
      additionalProperties: false
    VariantAudience:
      type: string
      enum:
        - plain
        - micro
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Scoped tsk_… API token or Access JWT

````