cURL
curl --request GET \
--url https://api.tela.com/prompt-versionimport requests
url = "https://api.tela.com/prompt-version"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/prompt-version', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/prompt-version")
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
List Prompt Versions
Returns a list of prompt versions for a specific prompt
GET
/
prompt-version
cURL
curl --request GET \
--url https://api.tela.com/prompt-versionimport requests
url = "https://api.tela.com/prompt-version"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/prompt-version', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/prompt-version")
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 Prompt Versions
This endpoint retrieves all prompt versions associated with a specific prompt ID.Required Parameters
| Parameter | Type | Description |
|---|---|---|
promptId | string (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)
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)
import requests
import os
api_key = os.getenv("TELA_API_KEY")
prompt_id = "prompt_uuid"
url = "https://api.tela.ai/prompt-version"
params = {
"promptId": prompt_id
}
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.get(url, params=params, headers=headers)
prompt_versions = response.json()
print(prompt_versions)
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"
}
]
Response
200 - application/json
List of prompt versions