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 response = await client.tests.listTestRuns('test_case_batch_job_id');
console.log(response.has_more);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
response = client.tests.list_test_runs(
test_case_batch_job_id="test_case_batch_job_id",
)
print(response.has_more)curl --request GET \
--url https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_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/v2/list-test-runs/{test_case_batch_job_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/v2/list-test-runs/{test_case_batch_job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_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{
"pagination_key": "<string>",
"has_more": true,
"items": [
{
"test_case_job_id": "<string>",
"test_case_definition_id": "<string>",
"test_case_definition_snapshot": {
"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
},
"creation_timestamp": 123,
"user_modified_timestamp": 123,
"transcript_snapshot": {},
"result_explanation": "<string>"
}
]
}{
"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."
}Test Runs
List Test Runs
List test case jobs (test runs) for a batch test job with pagination
GET
/
v2
/
list-test-runs
/
{test_case_batch_job_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 response = await client.tests.listTestRuns('test_case_batch_job_id');
console.log(response.has_more);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
response = client.tests.list_test_runs(
test_case_batch_job_id="test_case_batch_job_id",
)
print(response.has_more)curl --request GET \
--url https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_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/v2/list-test-runs/{test_case_batch_job_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/v2/list-test-runs/{test_case_batch_job_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/list-test-runs/{test_case_batch_job_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{
"pagination_key": "<string>",
"has_more": true,
"items": [
{
"test_case_job_id": "<string>",
"test_case_definition_id": "<string>",
"test_case_definition_snapshot": {
"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
},
"creation_timestamp": 123,
"user_modified_timestamp": 123,
"transcript_snapshot": {},
"result_explanation": "<string>"
}
]
}{
"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
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Path Parameters
ID of the batch test job
Query Parameters
Maximum number of items to return.
Required range:
x <= 1000Pagination key for fetching the next page.
Was this page helpful?
⌘I

