> ## 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.

# Get apiv1variants diff



## OpenAPI

````yaml /api/openapi.json get /api/v1/variants/{variantId}/diff
openapi: 3.1.0
info:
  title: Tessera API
  version: '1'
servers:
  - url: https://tessera.edstratumlabs.ai
    description: Production
security: []
paths:
  /api/v1/variants/{variantId}/diff:
    get:
      tags:
        - session
      operationId: getVariantDiff
      parameters:
        - name: variantId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariantDiff'
        '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:
    VariantDiff:
      type: object
      properties:
        variant:
          $ref: '#/components/schemas/LessonVariant'
        rows:
          type: array
          items:
            $ref: '#/components/schemas/VariantDiffRow'
      required:
        - variant
        - rows
      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: {}
    LessonVariant:
      type: object
      properties:
        lessonId:
          type: string
          minLength: 1
        masterLessonId:
          type: string
          minLength: 1
        audience:
          $ref: '#/components/schemas/VariantAudience'
        title:
          type: string
          minLength: 1
        minutes:
          type: integer
          minimum: 1
          maximum: 240
        status:
          type: string
          enum:
            - draft
            - published
        syncedAt:
          type: string
          minLength: 1
        divergedBlocks:
          type: number
          minimum: 0
        uncoveredBlocks:
          type: number
          minimum: 0
      required:
        - lessonId
        - masterLessonId
        - audience
        - title
        - minutes
        - status
        - syncedAt
        - divergedBlocks
        - uncoveredBlocks
      additionalProperties: false
    VariantDiffRow:
      type: object
      properties:
        state:
          type: string
          enum:
            - in-sync
            - diverged
            - master-removed
            - new-in-master
            - variant-only
        master:
          anyOf:
            - $ref: '#/components/schemas/Block'
            - type: 'null'
        variant:
          anyOf:
            - $ref: '#/components/schemas/Block'
            - type: 'null'
      required:
        - state
        - master
        - variant
      additionalProperties: false
    VariantAudience:
      type: string
      enum:
        - plain
        - micro
    Block:
      anyOf:
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: heading
            level:
              anyOf:
                - type: number
                  const: 2
                - type: number
                  const: 3
            text:
              type: string
              minLength: 1
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - level
            - text
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: text
            text:
              type: string
              minLength: 1
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - text
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: callout
            tone:
              type: string
              enum:
                - info
                - tip
                - warning
            title:
              type: string
            text:
              type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - tone
            - title
            - text
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: image
            src:
              type: string
              minLength: 1
            alt:
              type: string
            decorative:
              type: boolean
            caption:
              type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - src
            - alt
            - decorative
            - caption
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: check
            question:
              type: string
            options:
              minItems: 2
              maxItems: 6
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  text:
                    type: string
                required:
                  - id
                  - text
                additionalProperties: false
            correctOptionId:
              type: string
            feedbackCorrect:
              type: string
            feedbackIncorrect:
              type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - question
            - options
            - correctOptionId
            - feedbackCorrect
            - feedbackIncorrect
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: document
            title:
              type: string
              minLength: 1
            sections:
              minItems: 1
              maxItems: 40
              type: array
              items:
                type: object
                properties:
                  heading:
                    type: string
                    minLength: 1
                  text:
                    type: string
                    minLength: 1
                required:
                  - heading
                  - text
                additionalProperties: false
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - title
            - sections
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: file
            fileId:
              type: string
              minLength: 1
            title:
              type: string
              minLength: 1
            description:
              type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - fileId
            - title
            - description
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: video
            src:
              type: string
              minLength: 1
            provider:
              type: string
              enum:
                - youtube
                - vimeo
                - upload
            title:
              type: string
              minLength: 1
            captionsFileId:
              default: null
              anyOf:
                - type: string
                  minLength: 1
                - type: 'null'
            transcript:
              type: string
            minutes:
              default: 0
              type: integer
              minimum: 0
              maximum: 600
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - src
            - provider
            - title
            - captionsFileId
            - transcript
            - minutes
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: table
            caption:
              type: string
            headerRow:
              type: boolean
            rows:
              minItems: 1
              maxItems: 200
              type: array
              items:
                minItems: 1
                maxItems: 20
                type: array
                items:
                  type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - caption
            - headerRow
            - rows
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: scenario
            title:
              type: string
              minLength: 1
            setting:
              type: string
            nodes:
              minItems: 1
              maxItems: 60
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  text:
                    type: string
                    minLength: 1
                  choices:
                    maxItems: 6
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        text:
                          type: string
                          minLength: 1
                        nextNodeId:
                          type: string
                          minLength: 1
                        feedback:
                          type: string
                        quality:
                          type: string
                          enum:
                            - best
                            - okay
                            - poor
                      required:
                        - id
                        - text
                        - nextNodeId
                        - feedback
                        - quality
                      additionalProperties: false
                  outcome:
                    type: string
                required:
                  - id
                  - text
                  - choices
                  - outcome
                additionalProperties: false
            startNodeId:
              type: string
              minLength: 1
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - title
            - setting
            - nodes
            - startNodeId
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              minLength: 1
            lessonId:
              type: string
              minLength: 1
            position:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            origin:
              type: string
              enum:
                - human
                - ai
            aiState:
              anyOf:
                - type: string
                  enum:
                    - draft
                    - kept
                - type: 'null'
            provenance:
              anyOf:
                - $ref: '#/components/schemas/Provenance'
                - type: 'null'
            previous:
              anyOf:
                - $ref: '#/components/schemas/BlockContent'
                - type: 'null'
            updatedAt:
              type: string
              minLength: 1
            templateKey:
              type:
                - string
                - 'null'
            source:
              anyOf:
                - type: object
                  properties:
                    blockId:
                      type: string
                      minLength: 1
                    hash:
                      type: string
                      minLength: 1
                  required:
                    - blockId
                    - hash
                  additionalProperties: false
                - type: 'null'
            type:
              type: string
              const: link
            href:
              type: string
              minLength: 1
              pattern: ^https?:\/\/
            text:
              type: string
              minLength: 1
            description:
              type: string
          required:
            - id
            - lessonId
            - position
            - origin
            - aiState
            - provenance
            - previous
            - updatedAt
            - type
            - href
            - text
            - description
          additionalProperties: false
    Provenance:
      type: object
      properties:
        model:
          type: string
          minLength: 1
        task:
          type: string
          enum:
            - brief
            - outline
            - lesson-draft
            - block-regenerate
            - announcement
            - feedback
            - alt-text
            - rewrite
            - link-text
            - element
            - tutor
            - tutor-summary
            - agent
            - readiness-item
            - variant
        generatedAt:
          type: string
          minLength: 1
        sources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
            additionalProperties: false
        summary:
          type: string
      required:
        - model
        - task
        - generatedAt
        - sources
        - summary
      additionalProperties: false
    BlockContent:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              const: heading
            level:
              anyOf:
                - type: number
                  const: 2
                - type: number
                  const: 3
            text:
              type: string
              minLength: 1
          required:
            - type
            - level
            - text
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: text
            text:
              type: string
              minLength: 1
          required:
            - type
            - text
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: callout
            tone:
              type: string
              enum:
                - info
                - tip
                - warning
            title:
              type: string
            text:
              type: string
          required:
            - type
            - tone
            - title
            - text
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: image
            src:
              type: string
              minLength: 1
            alt:
              type: string
            decorative:
              type: boolean
            caption:
              type: string
          required:
            - type
            - src
            - alt
            - decorative
            - caption
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: check
            question:
              type: string
            options:
              minItems: 2
              maxItems: 6
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  text:
                    type: string
                required:
                  - id
                  - text
                additionalProperties: false
            correctOptionId:
              type: string
            feedbackCorrect:
              type: string
            feedbackIncorrect:
              type: string
          required:
            - type
            - question
            - options
            - correctOptionId
            - feedbackCorrect
            - feedbackIncorrect
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: document
            title:
              type: string
              minLength: 1
            sections:
              minItems: 1
              maxItems: 40
              type: array
              items:
                type: object
                properties:
                  heading:
                    type: string
                    minLength: 1
                  text:
                    type: string
                    minLength: 1
                required:
                  - heading
                  - text
                additionalProperties: false
          required:
            - type
            - title
            - sections
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: file
            fileId:
              type: string
              minLength: 1
            title:
              type: string
              minLength: 1
            description:
              type: string
          required:
            - type
            - fileId
            - title
            - description
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: video
            src:
              type: string
              minLength: 1
            provider:
              type: string
              enum:
                - youtube
                - vimeo
                - upload
            title:
              type: string
              minLength: 1
            captionsFileId:
              default: null
              anyOf:
                - type: string
                  minLength: 1
                - type: 'null'
            transcript:
              type: string
            minutes:
              default: 0
              type: integer
              minimum: 0
              maximum: 600
          required:
            - type
            - src
            - provider
            - title
            - captionsFileId
            - transcript
            - minutes
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: table
            caption:
              type: string
            headerRow:
              type: boolean
            rows:
              minItems: 1
              maxItems: 200
              type: array
              items:
                minItems: 1
                maxItems: 20
                type: array
                items:
                  type: string
          required:
            - type
            - caption
            - headerRow
            - rows
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: scenario
            title:
              type: string
              minLength: 1
            setting:
              type: string
            nodes:
              minItems: 1
              maxItems: 60
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  text:
                    type: string
                    minLength: 1
                  choices:
                    maxItems: 6
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          minLength: 1
                        text:
                          type: string
                          minLength: 1
                        nextNodeId:
                          type: string
                          minLength: 1
                        feedback:
                          type: string
                        quality:
                          type: string
                          enum:
                            - best
                            - okay
                            - poor
                      required:
                        - id
                        - text
                        - nextNodeId
                        - feedback
                        - quality
                      additionalProperties: false
                  outcome:
                    type: string
                required:
                  - id
                  - text
                  - choices
                  - outcome
                additionalProperties: false
            startNodeId:
              type: string
              minLength: 1
          required:
            - type
            - title
            - setting
            - nodes
            - startNodeId
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: link
            href:
              type: string
              minLength: 1
              pattern: ^https?:\/\/
            text:
              type: string
              minLength: 1
            description:
              type: string
          required:
            - type
            - href
            - text
            - description
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Scoped tsk_… API token or Access JWT

````