GET
/
test-case
/
{id}
curl --request GET \
  --url https://api.tela.com/test-case/{id}
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "title": "<string>",
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "variables": {},
  "variablesRichContent": {},
  "files": [
    {
      "index": 123,
      "name": "<string>",
      "mimeType": "<string>",
      "vaultUrl": "<string>",
      "variableName": "<string>",
      "url": "<string>"
    }
  ],
  "promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "expectedOutput": "<string>",
  "answers": {},
  "promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {
    "source": "workstation"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "deletedAt": "2023-11-07T05:31:56Z",
  "generations": [
    "<any>"
  ]
}

Retrieve a specific test case by its unique identifier.

Retrieve a Test Case

const API_KEY = process.env.TELA_API_KEY;
const testCaseId = 'test_case_uuid';

const response = await fetch(`https://api.tela.ai/test-case/${testCaseId}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

Parameters

NameTypeRequiredDescription
idstringYesThe UUID of the test case to retrieve

Response

The response returns a single test case object with the following properties:

FieldTypeDescription
idstringUnique identifier for the test case (UUID)
titlestringTitle of the test case
messagesarray or nullArray of message objects with role and content
variablesobject or nullKey-value pairs of variables used in the test case
variablesRichContentobject or nullKey-value pairs of rich content variables
filesarray or nullArray of file objects attached to the test case
promptIdstringUUID of the prompt this test case belongs to
expectedOutputstring or nullExpected output for evaluation purposes
answersobject or nullEvaluation answers with good/bad results and evals
promptApplicationIdstring or nullUUID of the prompt application if applicable
metadataobject or nullMetadata about the test case including source
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
deletedAtstring or nullDeletion timestamp if applicable

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Customer Support Query Test",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful customer support assistant."
    },
    {
      "role": "user",
      "content": "My order hasn't arrived yet."
    }
  ],
  "variables": {
    "customer_name": "John Doe",
    "order_id": "ORD-12345"
  },
  "variablesRichContent": null,
  "files": null,
  "promptId": "550e8400-e29b-41d4-a716-446655440001",
  "expectedOutput": "I'll help you track down your order, John. Let me look up order ORD-12345 for you.",
  "answers": {
    "version1": {
      "good": [],
      "bad": [],
      "evals": []
    }
  },
  "promptApplicationId": null,
  "metadata": {
    "source": "craft"
  },
  "createdAt": "2023-01-01T00:00:00.000Z",
  "updatedAt": "2023-01-02T00:00:00.000Z",
  "deletedAt": null
}

Path Parameters

id
string
required

Response

200 - application/json

Test case details

The response is of type object.