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

# Get the version index map of a canvas

> Returns every non-deleted version id of the canvas with its 1-based `versionIndex` (1 is the oldest) and the id of the version created immediately before it.



## OpenAPI

````yaml GET /prompt-version/index-map
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /prompt-version/index-map:
    get:
      tags:
        - Prompt Version
      summary: Get the version index map of a canvas
      description: >
        Returns every non-deleted version id of the canvas with its 1-based
        `versionIndex` (1 is the oldest) and

        the id of the version created immediately before it. Ordered from newest
        to oldest. Use it to translate

        between version ids and the human-readable version numbers shown in the
        UI.
      parameters:
        - name: promptId
          in: query
          required: true
          description: Canvas id.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The index map.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionIndexMapResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Missing or invalid credentials, or no access to the canvas's
            project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The project exists in the workspace but the caller's team has no
            access to it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Canvas not found (or a personal draft owned by someone else).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Query parameters failed validation (for example a missing
            `promptId`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    VersionIndexMapResponse:
      type: object
      properties:
        data:
          type: array
          description: Ordered from newest to oldest.
          items:
            $ref: '#/components/schemas/VersionIndexMapItem'
      required:
        - data
      example:
        data:
          - id: 9d2e4f6a-1b3c-4d5e-8f70-1a2b3c4d5e6f
            versionIndex: 3
            previousVersionId: 8c1d3e5f-0a2b-4c4d-9e6f-0a1b2c3d4e5f
          - id: 8c1d3e5f-0a2b-4c4d-9e6f-0a1b2c3d4e5f
            versionIndex: 2
            previousVersionId: 7b0c2d4e-9f1a-4b3c-8d5e-9f0a1b2c3d4e
          - id: 7b0c2d4e-9f1a-4b3c-8d5e-9f0a1b2c3d4e
            versionIndex: 1
            previousVersionId: null
    Error: {}
    VersionIndexMapItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        versionIndex:
          type: integer
          description: 1-based position among the canvas's versions (1 is the oldest).
        previousVersionId:
          type: string
          format: uuid
          nullable: true
          description: >-
            Id of the version created immediately before this one, or `null` for
            the oldest.
      required:
        - id
        - versionIndex
        - previousVersionId
  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.