PATCH
/
test-case
/
{id}
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": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "variables": {},
  "files": [
    {
      "index": 123,
      "name": "<string>",
      "mimeType": "<string>",
      "vaultUrl": "<string>",
      "variableName": "<string>",
      "url": "<string>"
    }
  ],
  "metadata": {
    "source": "workstation"
  }
}'

Update 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);

Parameters

NameTypeRequiredDescription
idstringYesThe 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.

FieldTypeDescription
titlestringTitle of the test case
messagesarrayArray of message objects with role and content
variablesobjectKey-value pairs of variables used in the test case
variablesRichContentobjectKey-value pairs of rich content variables
filesarrayArray of file objects to attach to the test case
promptIdstringUUID of the prompt this test case belongs to
expectedOutputstringExpected output for evaluation purposes
answersobjectEvaluation answers with good/bad results and evals
promptApplicationIdstringUUID of the prompt application if applicable
metadataobjectMetadata about the test case including source

Response

The response will contain the updated test case with all fields reflecting the changes.

Path Parameters

id
string
required

Body

application/json
title
string

Title of the test case

variablesRichContent
object

Key-value pairs of rich content variables

promptId
string

UUID of the prompt this test case belongs to

expectedOutput
string | null

Expected output for evaluation purposes

promptApplicationId
string | null

UUID of the prompt application if applicable

messages
object[]

Array of message objects with role and content

variables
object | null

Key-value pairs of variables used in the test case

files
object[] | null

Array of file objects to attach to the test case

metadata
object

Metadata about the test case

Response

200

Test case updated successfully