Skip to main content
GET
/
get-test-case-definition
/
{test_case_definition_id}
JavaScript
import Retell from 'retell-sdk';

const client = new Retell({
  apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});

const testCaseDefinitionResponse = await client.tests.getTestCaseDefinition(
  'test_case_definition_id',
);

console.log(testCaseDefinitionResponse.test_case_definition_id);
import os
from retell import Retell

client = Retell(
    api_key=os.environ.get("RETELL_API_KEY"),  # This is the default and can be omitted
)
test_case_definition_response = client.tests.get_test_case_definition(
    "test_case_definition_id",
)
print(test_case_definition_response.test_case_definition_id)
curl --request GET \
  --url https://api.retellai.com/get-test-case-definition/{test_case_definition_id} \
  --header 'Authorization: Bearer <token>'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.retellai.com/get-test-case-definition/{test_case_definition_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$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.retellai.com/get-test-case-definition/{test_case_definition_id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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.retellai.com/get-test-case-definition/{test_case_definition_id}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.retellai.com/get-test-case-definition/{test_case_definition_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "name": "<string>",
  "response_engine": {
    "type": "retell-llm",
    "llm_id": "<string>",
    "version": 0
  },
  "user_prompt": "<string>",
  "metrics": [
    "<string>"
  ],
  "dynamic_variables": {},
  "tool_mocks": [
    {
      "tool_name": "<string>",
      "input_match_rule": {
        "type": "any"
      },
      "output": "<string>",
      "result": true
    }
  ],
  "test_case_definition_id": "<string>",
  "type": "simulation",
  "creation_timestamp": 123,
  "user_modified_timestamp": 123
}
{
  "status": "error",
  "message": "Invalid request format, please check API reference."
}
{
  "status": "error",
  "message": "API key is missing or invalid."
}
{
  "status": "error",
  "message": "The requested resource was not found."
}
{
  "status": "error",
  "message": "Account rate limited, please throttle your requests."
}
{
  "status": "error",
  "message": "An unexpected server error occurred."
}

Authorizations

Authorization
string
header
required

Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"

Path Parameters

test_case_definition_id
string
required

ID of the test case definition to retrieve

Response

Test case definition retrieved successfully

name
string
required

Name of the test case definition

response_engine
object
required

Response engine to use for the test case. Custom LLM is not supported.

user_prompt
string
required

User prompt to simulate in the test case

metrics
string[]
required

Array of metric names to evaluate

dynamic_variables
object
required

Dynamic variables to inject into the response engine

tool_mocks
object[]
required

Mock tool calls for testing

llm_model
enum<string>
required

LLM model to use for simulation

Available options:
gpt-4.1,
gpt-4.1-mini,
gpt-4.1-nano,
gpt-5,
gpt-5-mini,
gpt-5-nano,
gpt-5.1,
gpt-5.2,
gpt-5.4,
gpt-5.4-mini,
gpt-5.4-nano,
gpt-5.5,
claude-4.5-sonnet,
claude-4.6-sonnet,
claude-5-sonnet,
claude-4.5-haiku,
gemini-3.0-flash,
gemini-3.1-flash-lite,
gemini-3.5-flash
test_case_definition_id
string
required

Unique identifier for the test case definition

type
enum<string>
required

Type of test case definition

Available options:
simulation
creation_timestamp
integer
required

Timestamp when the test case definition was created (milliseconds since epoch)

user_modified_timestamp
integer
required

Timestamp when the test case definition was last modified (milliseconds since epoch)