cURL
curl --request GET \
--url https://api.tela.com/prompt-version/{id}import requests
url = "https://api.tela.com/prompt-version/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/prompt-version/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/prompt-version/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/prompt-version/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/prompt-version/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/prompt-version/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"configuration": {
"model": "<string>",
"type": "chat",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"type": "file",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"content": "<string>",
"markdownContent": "<string>",
"promoted": true,
"draft": true,
"messages": {
"role": "user",
"content": "<string>",
"index": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Versions
Get Prompt Version
Retrieves a specific prompt version by ID
GET
/
prompt-version
/
{id}
cURL
curl --request GET \
--url https://api.tela.com/prompt-version/{id}import requests
url = "https://api.tela.com/prompt-version/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/prompt-version/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/prompt-version/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/prompt-version/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/prompt-version/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/prompt-version/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"configuration": {
"model": "<string>",
"type": "chat",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"type": "file",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"content": "<string>",
"markdownContent": "<string>",
"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
| Parameter | Type | Description |
|---|---|---|
id | string | The 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)
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)
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)
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"
}
Response
200 - application/json
Prompt version details