curl --request PATCH \
--url https://api.tela.com/prompt-version/{id} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"markdownContent": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"promoted": true,
"draft": true,
"messages": {
"content": "<string>",
"index": 123
}
}
'import requests
url = "https://api.tela.com/prompt-version/{id}"
payload = {
"title": "<string>",
"content": "<string>",
"markdownContent": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": True,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"processingOptions": { "allowMultimodal": True }
}
],
"promoted": True,
"draft": True,
"messages": {
"content": "<string>",
"index": 123
}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
markdownContent: '<string>',
configuration: {
model: '<string>',
temperature: 123,
structuredOutput: {enabled: true, schema: {}}
},
variables: [
{
name: '<string>',
required: true,
description: '<string>',
processingOptions: {allowMultimodal: true}
}
],
promoted: true,
draft: true,
messages: {content: '<string>', index: 123}
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'markdownContent' => '<string>',
'configuration' => [
'model' => '<string>',
'temperature' => 123,
'structuredOutput' => [
'enabled' => true,
'schema' => [
]
]
],
'variables' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'processingOptions' => [
'allowMultimodal' => true
]
]
],
'promoted' => true,
'draft' => true,
'messages' => [
'content' => '<string>',
'index' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/prompt-version/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tela.com/prompt-version/{id}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}")
.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::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"content": "<string>",
"markdownContent": "<string>",
"promoted": true,
"draft": true,
"messages": {
"content": "<string>",
"index": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Update Prompt Version
Updates an existing prompt version
curl --request PATCH \
--url https://api.tela.com/prompt-version/{id} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"markdownContent": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"promoted": true,
"draft": true,
"messages": {
"content": "<string>",
"index": 123
}
}
'import requests
url = "https://api.tela.com/prompt-version/{id}"
payload = {
"title": "<string>",
"content": "<string>",
"markdownContent": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": True,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": True,
"description": "<string>",
"processingOptions": { "allowMultimodal": True }
}
],
"promoted": True,
"draft": True,
"messages": {
"content": "<string>",
"index": 123
}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
markdownContent: '<string>',
configuration: {
model: '<string>',
temperature: 123,
structuredOutput: {enabled: true, schema: {}}
},
variables: [
{
name: '<string>',
required: true,
description: '<string>',
processingOptions: {allowMultimodal: true}
}
],
promoted: true,
draft: true,
messages: {content: '<string>', index: 123}
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'markdownContent' => '<string>',
'configuration' => [
'model' => '<string>',
'temperature' => 123,
'structuredOutput' => [
'enabled' => true,
'schema' => [
]
]
],
'variables' => [
[
'name' => '<string>',
'required' => true,
'description' => '<string>',
'processingOptions' => [
'allowMultimodal' => true
]
]
],
'promoted' => true,
'draft' => true,
'messages' => [
'content' => '<string>',
'index' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/prompt-version/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tela.com/prompt-version/{id}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}")
.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::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"markdownContent\": \"<string>\",\n \"configuration\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"structuredOutput\": {\n \"enabled\": true,\n \"schema\": {}\n }\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"processingOptions\": {\n \"allowMultimodal\": true\n }\n }\n ],\n \"promoted\": true,\n \"draft\": true,\n \"messages\": {\n \"content\": \"<string>\",\n \"index\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"configuration": {
"model": "<string>",
"temperature": 123,
"structuredOutput": {
"enabled": true,
"schema": {}
}
},
"variables": [
{
"name": "<string>",
"required": true,
"description": "<string>",
"processingOptions": {
"allowMultimodal": true
}
}
],
"content": "<string>",
"markdownContent": "<string>",
"promoted": true,
"draft": true,
"messages": {
"content": "<string>",
"index": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Update a Prompt Version
This endpoint updates an existing prompt version with new configuration, variables, or content.URL Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of the prompt version to update |
Request Body
The request body may include any of the following fields to update:| Parameter | Type | Description |
|---|---|---|
title | string | The title of the prompt version (max 256 characters) |
content | string | Plain text content of the prompt |
markdownContent | string | Markdown content of the prompt |
configuration | object | Configuration settings for the prompt version |
variables | array | An array of variable objects used in the prompt |
promoted | boolean | Whether this version is promoted |
draft | boolean | Whether this version is a draft |
messages | array/object | Messages for chat-type prompts |
Examples
const promptVersionId = 'version_uuid'
const updateData = {
title: 'Document Analysis v2.1',
configuration: {
temperature: 0.5 // Updating just the temperature
},
promoted: true,
draft: false
}
const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
})
const updatedVersion = await response.json()
console.log(updatedVersion)
const promptVersionId = 'version_uuid'
const updateData = {
title: 'Document Analysis v2.1',
configuration: {
temperature: 0.5 // Updating just the temperature
},
promoted: true,
draft: false
}
const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
})
const updatedVersion = await response.json()
console.log(updatedVersion)
import requests
import os
api_key = os.getenv("TELA_API_KEY")
prompt_version_id = "version_uuid"
update_data = {
"title": "Document Analysis v2.1",
"configuration": {
"temperature": 0.5 # Updating just the temperature
},
"promoted": True,
"draft": False
}
url = f"https://api.tela.ai/prompt-version/{prompt_version_id}"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.patch(url, json=update_data, headers=headers)
updated_version = response.json()
print(updated_version)
Response
The response includes the updated prompt version object with the changes applied.{
"id": "version_uuid",
"promptId": "prompt_uuid",
"title": "Document Analysis v2.1",
"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.5,
"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-15T14:30:00.000Z"
}
Update Variables Example
const promptVersionId = 'version_uuid'
const updateData = {
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'
},
{
name: 'format',
type: 'text',
required: false,
description: 'Preferred format for the analysis (bullet points, paragraph, etc.)'
}
]
}
const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
})
const updatedVersion = await response.json()
console.log(updatedVersion)
const promptVersionId = 'version_uuid'
const updateData = {
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'
},
{
name: 'format',
type: 'text',
required: false,
description: 'Preferred format for the analysis (bullet points, paragraph, etc.)'
}
]
}
const response = await fetch(`https://api.tela.ai/prompt-version/${promptVersionId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.TELA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
})
const updatedVersion = await response.json()
console.log(updatedVersion)
import requests
import os
api_key = os.getenv("TELA_API_KEY")
prompt_version_id = "version_uuid"
update_data = {
"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"
},
{
"name": "format",
"type": "text",
"required": False,
"description": "Preferred format for the analysis (bullet points, paragraph, etc.)"
}
]
}
url = f"https://api.tela.ai/prompt-version/{prompt_version_id}"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.patch(url, json=update_data, headers=headers)
updated_version = response.json()
print(updated_version)
Path Parameters
Body
Title of the prompt version
256Plain text content of the prompt version
Markdown content of the prompt version
Configuration settings for the prompt version
Show child attributes
Show child attributes
Array of variables used in the prompt
Show child attributes
Show child attributes
Whether this version is promoted
Whether this version is a draft
Messages for chat-type prompts
- object
- object[]
Show child attributes
Show child attributes
Response
Prompt version updated successfully
Unique identifier for the prompt version
UUID of the prompt this version belongs to
Title of the prompt version
256Configuration settings for the prompt version
Show child attributes
Show child attributes
Array of variables used in the prompt
Show child attributes
Show child attributes
Plain text content of the prompt version
Markdown content of the prompt version
Whether this version is promoted
Whether this version is a draft
Messages for chat-type prompts
- object
- object[]
Show child attributes
Show child attributes
Creation timestamp
Last update timestamp