cURL
curl --request PATCH \
--url https://api.tela.com/test-case/{id} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"variablesRichContent": {},
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messages": [
{
"content": "<string>"
}
],
"variables": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"metadata": {}
}
'import requests
url = "https://api.tela.com/test-case/{id}"
payload = {
"title": "<string>",
"variablesRichContent": {},
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messages": [{ "content": "<string>" }],
"variables": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"metadata": {}
}
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>',
variablesRichContent: {},
promptId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedOutput: '<string>',
promptApplicationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
messages: [{content: '<string>'}],
variables: {},
files: [
{
index: 123,
name: '<string>',
mimeType: '<string>',
vaultUrl: '<string>',
variableName: '<string>',
url: '<string>'
}
],
metadata: {}
})
};
fetch('https://api.tela.com/test-case/{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/test-case/{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>',
'variablesRichContent' => [
],
'promptId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedOutput' => '<string>',
'promptApplicationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'messages' => [
[
'content' => '<string>'
]
],
'variables' => [
],
'files' => [
[
'index' => 123,
'name' => '<string>',
'mimeType' => '<string>',
'vaultUrl' => '<string>',
'variableName' => '<string>',
'url' => '<string>'
]
],
'metadata' => [
]
]),
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/test-case/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\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/test-case/{id}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/test-case/{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 \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyTest Case
Update Test Case
Update an existing test case
PATCH
/
test-case
/
{id}
cURL
curl --request PATCH \
--url https://api.tela.com/test-case/{id} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"variablesRichContent": {},
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messages": [
{
"content": "<string>"
}
],
"variables": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"metadata": {}
}
'import requests
url = "https://api.tela.com/test-case/{id}"
payload = {
"title": "<string>",
"variablesRichContent": {},
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messages": [{ "content": "<string>" }],
"variables": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"metadata": {}
}
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>',
variablesRichContent: {},
promptId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expectedOutput: '<string>',
promptApplicationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
messages: [{content: '<string>'}],
variables: {},
files: [
{
index: 123,
name: '<string>',
mimeType: '<string>',
vaultUrl: '<string>',
variableName: '<string>',
url: '<string>'
}
],
metadata: {}
})
};
fetch('https://api.tela.com/test-case/{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/test-case/{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>',
'variablesRichContent' => [
],
'promptId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expectedOutput' => '<string>',
'promptApplicationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'messages' => [
[
'content' => '<string>'
]
],
'variables' => [
],
'files' => [
[
'index' => 123,
'name' => '<string>',
'mimeType' => '<string>',
'vaultUrl' => '<string>',
'variableName' => '<string>',
'url' => '<string>'
]
],
'metadata' => [
]
]),
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/test-case/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\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/test-case/{id}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/test-case/{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 \"variablesRichContent\": {},\n \"promptId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expectedOutput\": \"<string>\",\n \"promptApplicationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"variables\": {},\n \"files\": [\n {\n \"index\": 123,\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"vaultUrl\": \"<string>\",\n \"variableName\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyUpdate an existing test case by its unique identifier.
Update a Test Case
const API_KEY = process.env.TELA_API_KEY;
const testCaseId = 'test_case_uuid';
const updateData = {
title: "Updated Customer Support Query Test",
expectedOutput: "I'll help you track down your order right away, John. Let me check the status of order ORD-12345.",
messages: [
{
role: "system",
content: "You are a helpful and efficient customer support assistant."
},
{
role: "user",
content: "My order hasn't arrived yet."
}
]
};
const response = await fetch(`https://api.tela.ai/test-case/${testCaseId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
});
const data = await response.json();
console.log(data);
import requests
API_KEY = os.getenv('TELA_API_KEY')
test_case_id = 'test_case_uuid'
update_data = {
"title": "Updated Customer Support Query Test",
"expectedOutput": "I'll help you track down your order right away, John. Let me check the status of order ORD-12345.",
"messages": [
{
"role": "system",
"content": "You are a helpful and efficient customer support assistant."
},
{
"role": "user",
"content": "My order hasn't arrived yet."
}
]
}
response = requests.patch(
f'https://api.tela.ai/test-case/{test_case_id}',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
},
json=update_data
)
print(response.json())
const API_KEY = process.env.TELA_API_KEY;
const testCaseId = 'test_case_uuid';
const updateData = {
title: "Updated Customer Support Query Test",
expectedOutput: "I'll help you track down your order right away, John. Let me check the status of order ORD-12345.",
messages: [
{
role: "system",
content: "You are a helpful and efficient customer support assistant."
},
{
role: "user",
content: "My order hasn't arrived yet."
}
]
};
fetch(`https://api.tela.ai/test-case/${testCaseId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(updateData)
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The UUID of the test case to update |
Request Body
The request body can include any of the following fields to update. Only include the fields you want to modify.| Field | Type | Description |
|---|---|---|
title | string | Title of the test case |
messages | array | Array of message objects with role and content |
variables | object | Key-value pairs of variables used in the test case |
variablesRichContent | object | Key-value pairs of rich content variables |
files | array | Array of file objects to attach to the test case |
promptId | string | UUID of the prompt this test case belongs to |
expectedOutput | string | Expected output for evaluation purposes |
answers | object | Evaluation answers with good/bad results and evals |
promptApplicationId | string | UUID of the prompt application if applicable |
metadata | object | Metadata about the test case including source |
Response
The response will contain the updated test case with all fields reflecting the changes.Path Parameters
Body
application/json
Title of the test case
Key-value pairs of rich content variables
Show child attributes
Show child attributes
UUID of the prompt this test case belongs to
Expected output for evaluation purposes
UUID of the prompt application if applicable
Array of message objects with role and content
Show child attributes
Show child attributes
Key-value pairs of variables used in the test case
Show child attributes
Show child attributes
Array of file objects to attach to the test case
Show child attributes
Show child attributes
Metadata about the test case
Show child attributes
Show child attributes
Response
200
Test case updated successfully
⌘I