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

# Version history of a CodeGen script

> Every change to the script the pipeline runs for `kind` (generated at save or at a run, regenerated, pulled from the code repository, imported by a catalog restore, or restored from this history), newest first. A script stored before script versioning is listed as version 1 "(seeded from pre-versioning state)". Retention is `versionCap` per pipeline and kind. The pipeline's definition version does not change when its script does. Requires `pipeline:read`.



## OpenAPI

````yaml /openapi.yaml get /api/v1/pipelines/{name}/codegen-scripts/{kind}/versions
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.28.0
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/pipelines/{name}/codegen-scripts/{kind}/versions:
    get:
      tags:
        - Pipelines
      summary: Version history of a CodeGen script
      description: >-
        Every change to the script the pipeline runs for `kind` (generated at
        save or at a run, regenerated, pulled from the code repository, imported
        by a catalog restore, or restored from this history), newest first. A
        script stored before script versioning is listed as version 1 "(seeded
        from pre-versioning state)". Retention is `versionCap` per pipeline and
        kind. The pipeline's definition version does not change when its script
        does. Requires `pipeline:read`.
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
        - in: path
          name: kind
          required: true
          schema:
            type: string
            enum:
              - dataQuality
              - transformation
      responses:
        '200':
          description: Versions, newest first
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CodeGenScriptVersionSummary'
        '400':
          description: Unknown kind
        '404':
          description: Unknown pipeline
components:
  schemas:
    CodeGenScriptVersionSummary:
      type: object
      description: One version of a pipeline's CodeGen script, without its text.
      properties:
        version:
          type: integer
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
          nullable: true
          description: Key label or user that made the change; null for a run.
        changeNote:
          type: string
          nullable: true
          description: >-
            For example `(seeded from pre-versioning state)`, `restored from
            version 2`, `imported from catalog archive`, `adopted repository
            commit abc1234`.
        origin:
          type: string
          enum:
            - save
            - run
            - regenerate
            - repository
            - restore
            - restore-version
        model:
          type: string
          nullable: true
          description: The CodeGen model that wrote this text.
        commitSha:
          type: string
          nullable: true
          description: Code repository only. The commit holding this text.
        fingerprintMatchesCurrent:
          type: boolean
          description: >-
            True when the version was written for the pipeline's current
            instruction and source schema (only those versions can be restored).
        isLive:
          type: boolean
          description: True for the version runs execute now.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````

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