GET
/
prompt-version
curl --request GET \
  --url https://api.tela.com/prompt-version
[
  {
    "id": "<string>",
    "promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "title": "<string>",
    "content": "<string>",
    "markdownContent": "<string>",
    "configuration": {
      "model": "<string>",
      "temperature": 123,
      "type": "chat",
      "structuredOutput": {
        "enabled": true,
        "schema": {}
      }
    },
    "variables": [
      {
        "name": "<string>",
        "type": "file",
        "required": true,
        "description": "<string>",
        "processingOptions": {
          "allowMultimodal": true
        }
      }
    ],
    "promoted": true,
    "draft": true,
    "messages": {
      "role": "user",
      "content": "<string>",
      "index": 123
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
]

Retrieve Prompt Versions

This endpoint retrieves all prompt versions associated with a specific prompt ID.

Required Parameters

ParameterTypeDescription
promptIdstring (UUID)The ID of the prompt to retrieve versions for

Examples

const promptId = 'prompt_uuid'

// Build URL with query parameters
const url = new URL('https://api.tela.ai/prompt-version')
url.searchParams.append('promptId', promptId)

const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
    'Content-Type': 'application/json'
  }
})

const promptVersions = await response.json()
console.log(promptVersions)

Response

The response includes an array of prompt version objects associated with the specified prompt ID.

[
  {
    "id": "version_uuid",
    "promptId": "prompt_uuid",
    "title": "My Prompt Version",
    "content": "Prompt content...",
    "markdownContent": "# Markdown content...",
    "configuration": {
      "model": "claude-3-opus-20240229",
      "temperature": 0.7,
      "type": "chat"
    },
    "variables": [
      {
        "name": "document",
        "type": "file",
        "required": true,
        "description": "The document to analyze"
      }
    ],
    "promoted": true,
    "draft": false,
    "createdAt": "2024-04-01T12:00:00.000Z",
    "updatedAt": "2024-04-01T12:30:00.000Z"
  }
]

Query Parameters

promptId
string
required

Response

200 - application/json
List of prompt versions
id
string
required

Unique identifier for the prompt version

promptId
string
required

UUID of the prompt this version belongs to

title
string
required

Title of the prompt version

Maximum length: 256
configuration
object
required

Configuration settings for the prompt version

variables
object[]
required

Array of variables used in the prompt

content
string | null

Plain text content of the prompt version

markdownContent
string | null

Markdown content of the prompt version

promoted
boolean | null

Whether this version is promoted

draft
boolean | null

Whether this version is a draft

messages

Messages for chat-type prompts

createdAt
string

Creation timestamp

updatedAt
string

Last update timestamp