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

# Get prompt versions

> Get all versions for a prompt. Does not include base prompt data, only versioned data.



## OpenAPI

````yaml GET /api/prompts/{id}/versions
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - api_key: []
paths:
  /api/prompts/{id}/versions:
    get:
      description: >-
        Get all versions for a prompt. Does not include base prompt data, only
        versioned data.
      operationId: getApiPromptsByIdVersions
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    handle:
                      type:
                        - string
                        - 'null'
                    scope:
                      type: string
                      enum:
                        - ORGANIZATION
                        - PROJECT
                    name:
                      type: string
                    updatedAt:
                      type: string
                    projectId:
                      type: string
                    organizationId:
                      type: string
                    versionId:
                      type: string
                    authorId:
                      type:
                        - string
                        - 'null'
                    version:
                      type: number
                    createdAt:
                      type: string
                    commitMessage:
                      type:
                        - string
                        - 'null'
                    prompt:
                      type: string
                    messages:
                      type: array
                      items:
                        type: object
                        properties:
                          role:
                            type: string
                            enum:
                              - user
                              - assistant
                              - system
                          content:
                            type: string
                        required:
                          - role
                          - content
                      default: []
                    inputs:
                      type: array
                      items:
                        type: object
                        properties:
                          identifier:
                            type: string
                            minLength: 1
                          type:
                            type: string
                            enum:
                              - str
                              - float
                              - bool
                              - image
                              - list
                              - list[str]
                              - list[float]
                              - list[int]
                              - list[bool]
                              - dict
                              - chat_messages
                        required:
                          - identifier
                          - type
                      default: []
                    outputs:
                      type: array
                      items:
                        type: object
                        properties:
                          identifier:
                            type: string
                            minLength: 1
                          type:
                            type: string
                            enum:
                              - str
                              - float
                              - bool
                              - json_schema
                          json_schema:
                            type: object
                            properties:
                              type:
                                type: string
                                minLength: 1
                            required:
                              - type
                            additionalProperties: true
                        required:
                          - identifier
                          - type
                      minItems: 1
                    model:
                      type: string
                      minLength: 1
                    temperature:
                      type: number
                    maxTokens:
                      type: number
                    demonstrations:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        inline:
                          type: object
                          properties:
                            records:
                              type: object
                              additionalProperties:
                                type: array
                                items: {}
                            columnTypes:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    anyOf:
                                      - type: string
                                        const: string
                                      - type: string
                                        const: boolean
                                      - type: string
                                        const: number
                                      - type: string
                                        const: date
                                      - type: string
                                        const: list
                                      - type: string
                                        const: json
                                      - type: string
                                        const: spans
                                      - type: string
                                        const: rag_contexts
                                      - type: string
                                        const: chat_messages
                                      - type: string
                                        const: annotations
                                      - type: string
                                        const: evaluations
                                      - type: string
                                        const: image
                                required:
                                  - name
                                  - type
                          required:
                            - records
                            - columnTypes
                    promptingTechnique:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - few_shot
                            - in_context
                            - chain_of_thought
                        demonstrations:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            inline:
                              type: object
                              properties:
                                records:
                                  type: object
                                  additionalProperties:
                                    type: array
                                    items: {}
                                columnTypes:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      name:
                                        type: string
                                      type:
                                        anyOf:
                                          - type: string
                                            const: string
                                          - type: string
                                            const: boolean
                                          - type: string
                                            const: number
                                          - type: string
                                            const: date
                                          - type: string
                                            const: list
                                          - type: string
                                            const: json
                                          - type: string
                                            const: spans
                                          - type: string
                                            const: rag_contexts
                                          - type: string
                                            const: chat_messages
                                          - type: string
                                            const: annotations
                                          - type: string
                                            const: evaluations
                                          - type: string
                                            const: image
                                    required:
                                      - name
                                      - type
                              required:
                                - records
                                - columnTypes
                      required:
                        - type
                    responseFormat:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - json_schema
                        json_schema:
                          type:
                            - object
                            - 'null'
                          properties:
                            name:
                              type: string
                            schema:
                              type: object
                              additionalProperties: true
                          required:
                            - name
                            - schema
                      required:
                        - type
                        - json_schema
                  required:
                    - id
                    - handle
                    - scope
                    - name
                    - updatedAt
                    - projectId
                    - organizationId
                    - versionId
                    - version
                    - createdAt
                    - prompt
                    - messages
                    - inputs
                    - outputs
                    - model
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '404':
          description: Prompt not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Auth-Token

````