> ## 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 Prompt Version

> Retrieves a specific prompt version by ID

## Retrieve a Prompt Version

This endpoint retrieves a specific prompt version by its ID.

### URL Parameters

| Parameter | Type   | Description                              |
| --------- | ------ | ---------------------------------------- |
| `id`      | string | The ID of the prompt version to retrieve |

### Examples

<CodeGroup>
  ```typescript typescript theme={null}
  const promptVersionId = 'version_uuid'

  const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
      'Content-Type': 'application/json'
    }
  })

  const promptVersion = await response.json()
  console.log(promptVersion)
  ```

  ```javascript javascript theme={null}
  const promptVersionId = 'version_uuid'

  const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
      'Content-Type': 'application/json'
    }
  })

  const promptVersion = await response.json()
  console.log(promptVersion)
  ```

  ```python python theme={null}
  import requests
  import os

  api_key = os.getenv("TELA_API_KEY")
  prompt_version_id = "version_uuid"

  url = f"https://api.tela.ai/prompt-version/{prompt_version_id}"

  headers = {
      "Authorization": f"Bearer {api_key}",
      "Content-Type": "application/json"
  }

  response = requests.get(url, headers=headers)
  prompt_version = response.json()
  print(prompt_version)
  ```
</CodeGroup>

### Response

The response includes the requested prompt version object with all its details.

```json theme={null}
{
  "id": "version_uuid",
  "promptId": "prompt_uuid",
  "title": "Document Analysis v2",
  "content": "Analyze the following document and answer the question.",
  "markdownContent": "# Document Analysis\n\nAnalyze the following document and answer the question.",
  "configuration": {
    "model": "claude-3-opus-20240229",
    "temperature": 0.7,
    "type": "chat"
  },
  "variables": [
    {
      "name": "document",
      "type": "file",
      "required": true,
      "description": "The document to analyze"
    },
    {
      "name": "query",
      "type": "text",
      "required": true,
      "description": "The specific question about the document"
    }
  ],
  "promoted": true,
  "draft": false,
  "messages": [
    {
      "role": "system",
      "content": "You are a document analysis assistant."
    },
    {
      "role": "user",
      "content": "Please analyze the document {{document}} and answer this question: {{query}}"
    }
  ],
  "createdAt": "2024-04-01T12:00:00.000Z",
  "updatedAt": "2024-04-01T12:30:00.000Z"
}
```


## OpenAPI

````yaml GET /prompt-version/{id}
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/{id}:
    get:
      description: Retrieve a specific prompt version
      operationId: getPromptVersionById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Prompt version details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptVersionResponse'
components:
  schemas:
    PromptVersionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the prompt version
        promptId:
          type: string
          format: uuid
          description: UUID of the prompt this version belongs to
        title:
          type: string
          maxLength: 256
          description: Title of the prompt version
        content:
          type: string
          nullable: true
          description: Plain text content of the prompt version
        markdownContent:
          type: string
          nullable: true
          description: Markdown content of the prompt version
        configuration:
          type: object
          description: Configuration settings for the prompt version
          properties:
            model:
              type: string
              description: The model to use for this prompt version
            temperature:
              type: number
              description: Temperature setting for model generation
            type:
              type: string
              enum:
                - chat
                - completion
              description: Type of prompt (chat or completion)
            structuredOutput:
              type: object
              description: Settings for structured output
              properties:
                enabled:
                  type: boolean
                  description: Whether structured output is enabled
                schema:
                  type: object
                  description: JSON schema for structured output
          required:
            - model
            - type
        variables:
          type: array
          description: Array of variables used in the prompt
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the variable
              type:
                type: string
                enum:
                  - file
                  - text
                description: Type of the variable
              required:
                type: boolean
                description: Whether this variable is required
              description:
                type: string
                description: Description of the variable
              processingOptions:
                type: object
                description: Processing options for the variable
                properties:
                  allowMultimodal:
                    type: boolean
                    description: Whether multimodal processing is allowed
            required:
              - name
              - type
              - required
        promoted:
          type: boolean
          nullable: true
          description: Whether this version is promoted
        draft:
          type: boolean
          nullable: true
          description: Whether this version is a draft
        messages:
          description: Messages for chat-type prompts
          oneOf:
            - type: object
              properties:
                role:
                  type: string
                  enum:
                    - user
                    - assistant
                    - system
                    - function
                content:
                  type: string
                  nullable: true
                index:
                  type: integer
              required:
                - role
            - type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - user
                      - assistant
                      - system
                      - function
                  content:
                    type: string
                    nullable: true
                  index:
                    type: integer
                required:
                  - role
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
      required:
        - id
        - promptId
        - title
        - configuration
        - variables

````