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

# List environment publication history

> Returns the publication history of one environment, newest publication first. Every time a version is published to the environment a new publication record is created and the previous one is marked unpublished, so the item with `isActive: true` (and `unpublishedAt: null`) is the version currently served by the environment.



## OpenAPI

````yaml GET /environment/versions
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /environment/versions:
    get:
      tags:
        - Environment
      summary: List environment publication history
      description: >
        Returns the publication history of one environment, newest publication
        first. Every time a version is

        published to the environment a new publication record is created and the
        previous one is marked

        unpublished, so the item with `isActive: true` (and `unpublishedAt:
        null`) is the version currently

        served by the environment.


        `envName` accepts `production` or any custom environment name. For
        `production` the system environment

        is created on demand if missing; for any other name the environment must
        already exist (`404` otherwise).
      operationId: listEnvironmentVersionHistory
      parameters:
        - $ref: '#/components/parameters/EnvironmentResourceTypeQuery'
        - $ref: '#/components/parameters/EnvironmentResourceIdQuery'
        - $ref: '#/components/parameters/EnvironmentNameQuery'
        - name: limit
          in: query
          required: false
          description: Page size. Defaults to 20, clamped to 1–100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: offset
          in: query
          required: false
          description: Number of items to skip. Defaults to 0.
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: objectLinks
          in: query
          required: false
          description: >-
            When `true`, `meta.links` are returned as objects (`{ limit, offset,
            ...filters }`) instead of query strings.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Paginated publication history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentVersionHistoryResponse'
        '400':
          description: Invalid environment name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/EnvironmentUnauthorized'
        '403':
          $ref: '#/components/responses/EnvironmentForbidden'
        '404':
          $ref: '#/components/responses/EnvironmentNotFound'
        '422':
          $ref: '#/components/responses/EnvironmentValidationError'
      security:
        - bearerAuth: []
components:
  parameters:
    EnvironmentResourceTypeQuery:
      name: resourceType
      in: query
      required: true
      description: >-
        Type of resource the environment belongs to. Only `prompt` (a canvas) is
        supported.
      schema:
        $ref: '#/components/schemas/EnvironmentResourceType'
    EnvironmentResourceIdQuery:
      name: resourceId
      in: query
      required: true
      description: Canvas (prompt) ID.
      schema:
        type: string
        format: uuid
    EnvironmentNameQuery:
      name: envName
      in: query
      required: true
      description: Environment name (`production` or a custom name).
      schema:
        $ref: '#/components/schemas/EnvironmentName'
  schemas:
    EnvironmentVersionHistoryResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EnvironmentVersionHistoryItem'
        meta:
          $ref: '#/components/schemas/EnvironmentPaginationMeta'
      required:
        - data
        - meta
      example:
        data:
          - publicationId: 5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a
            environmentId: 2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b
            environmentName: staging
            environmentIsSystem: false
            versionId: 76065caa-c519-441a-8fe2-cc43e29664ab
            promptId: 95cec438-6080-44fe-8275-28b16bd40178
            title: Contract analysis v3
            promoted: false
            draft: false
            originVersionId: 1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b
            versionIndex: 3
            createdBy: jane@example.com
            updatedBy: jane@example.com
            createdAt: '2025-06-02T15:40:00.000Z'
            updatedAt: '2025-06-03T10:12:45.000Z'
            publishedAt: '2025-06-03T10:12:45.000Z'
            publishedBy: jane@example.com
            unpublishedAt: null
            isActive: true
          - publicationId: 4c3b2a19-0e1f-4c8b-9a7f-5e4d3c2b1a09
            environmentId: 2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b
            environmentName: staging
            environmentIsSystem: false
            versionId: 1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b
            promptId: 95cec438-6080-44fe-8275-28b16bd40178
            title: Contract analysis v2
            promoted: false
            draft: false
            originVersionId: null
            versionIndex: 2
            createdBy: jane@example.com
            updatedBy: jane@example.com
            createdAt: '2025-05-28T11:00:00.000Z'
            updatedAt: '2025-06-01T12:30:00.000Z'
            publishedAt: '2025-06-01T12:30:00.000Z'
            publishedBy: jane@example.com
            unpublishedAt: '2025-06-03T10:12:45.000Z'
            isActive: false
        meta:
          totalCount: 2
          limit: 20
          offset: 0
          currentPage: 1
          totalPages: 1
          links:
            first: >-
              ?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0
            last: >-
              ?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0
            next: null
            previous: null
    Error: {}
    EnvironmentResourceType:
      type: string
      enum:
        - prompt
      description: >-
        Resource type an environment is attached to. Only canvases (`prompt`)
        are supported today.
    EnvironmentName:
      type: string
      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
      maxLength: 64
      description: >
        Environment name. Lowercase letters, digits and single hyphens between
        segments (no leading, trailing

        or consecutive hyphens), at most 64 characters. Leading/trailing
        whitespace is trimmed before validation.


        `production` is the system environment every canvas has; it is the only
        reserved name you can publish to.

        The names `production`, `promoted`, `latest` and `draft` are reserved
        and cannot be used for custom

        environments, and a custom name cannot be a UUID.


        The same rules apply to the `environment_name` field of `POST
        /v2/chat/completions`, which runs the

        version currently published to that environment of the given `canvas_id`
        (`environment_name` cannot be

        combined with `version_id` or `application_id`, and returns `404` when
        the environment does not exist or

        has no published version).
      example: staging
    EnvironmentVersionHistoryItem:
      type: object
      description: One publication of a version to an environment.
      properties:
        publicationId:
          type: string
          format: uuid
        environmentId:
          type: string
          format: uuid
        environmentName:
          type: string
        environmentIsSystem:
          type: boolean
        versionId:
          type: string
          format: uuid
        promptId:
          type: string
          format: uuid
        title:
          type: string
          description: Version title
        promoted:
          type: boolean
          nullable: true
        draft:
          type: boolean
          nullable: true
        originVersionId:
          type: string
          format: uuid
          nullable: true
        versionIndex:
          type: integer
          description: 1-based position of the version in the canvas history.
        createdBy:
          type: string
        updatedBy:
          type: string
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        publishedAt:
          type: string
          format: date-time
        publishedBy:
          type: string
        unpublishedAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            When a later publication replaced this one. `null` for the active
            publication.
        isActive:
          type: boolean
          description: >-
            `true` when this publication is the one currently served by the
            environment.
      required:
        - publicationId
        - environmentId
        - environmentName
        - environmentIsSystem
        - versionId
        - promptId
        - title
        - promoted
        - draft
        - originVersionId
        - versionIndex
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
        - publishedAt
        - publishedBy
        - unpublishedAt
        - isActive
    EnvironmentPaginationMeta:
      type: object
      properties:
        totalCount:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
        currentPage:
          type: integer
        totalPages:
          type: integer
        lastReference:
          type: integer
        links:
          type: object
          description: >-
            Query strings for the neighbouring pages, or objects when
            `objectLinks=true` was passed.
          properties:
            first:
              oneOf:
                - type: string
                - type: object
            last:
              oneOf:
                - type: string
                - type: object
            next:
              nullable: true
              oneOf:
                - type: string
                - type: object
            previous:
              nullable: true
              oneOf:
                - type: string
                - type: object
          required:
            - first
            - last
            - next
            - previous
      required:
        - totalCount
        - limit
        - offset
        - currentPage
        - totalPages
        - links
  responses:
    EnvironmentUnauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EnvironmentForbidden:
      description: The key does not have the required role or access to the canvas' project
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EnvironmentNotFound:
      description: Canvas or environment not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EnvironmentValidationError:
      description: Request body or query failed schema validation (`code` is `VALIDATION`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or UUID

````

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