GET
/
prompt-version
/
{id}
curl --request GET \
  --url https://api.tela.com/prompt-version/{id}
{
  "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 a Prompt Version

This endpoint retrieves a specific prompt version by its ID.

URL Parameters

ParameterTypeDescription
idstringThe ID of the prompt version to retrieve

Examples

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)

Response

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

{
  "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"
}

Path Parameters

id
string
required

Response

200 - application/json
Prompt version details
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