Skip to main content
GET
/
list-test-case-definitions
JavaScript
import Retell from 'retell-sdk';

const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
});

const testCaseDefinitionResponses = await client.tests.listTestCaseDefinitions({
  type: 'retell-llm',
});

console.log(testCaseDefinitionResponses);
[
  {
    "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
      }
    ],
    "llm_model": "gpt-4.1",
    "test_case_definition_id": "<string>",
    "type": "simulation",
    "creation_timestamp": 123,
    "user_modified_timestamp": 123
  }
]

Authorizations

Authorization
string
header
required

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

Query Parameters

type
enum<string>
required

Type of response engine

Available options:
retell-llm,
conversation-flow
llm_id
string

LLM ID (required when type is retell-llm)

conversation_flow_id
string

Conversation flow ID (required when type is conversation-flow)

version
integer

Version of the response engine (defaults to latest)

Response

Test case definitions 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.1,
gpt-5.2,
gpt-5-mini,
gpt-5-nano,
claude-4.5-sonnet,
claude-4.5-haiku,
gemini-2.5-flash,
gemini-2.5-flash-lite,
gemini-3.0-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)