Run Test Scenario
curl --request POST \
--url https://api.bland.ai/v1/agent-testing/scenarios/{id}/run \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"version_number": 123,
"request_data_override": {},
"webhook_url": "<string>"
}
'import requests
url = "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run"
payload = {
"version_number": 123,
"request_data_override": {},
"webhook_url": "<string>"
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({version_number: 123, request_data_override: {}, webhook_url: '<string>'})
};
fetch('https://api.bland.ai/v1/agent-testing/scenarios/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version_number' => 123,
'request_data_override' => [
],
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run"
payload := strings.NewReader("{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bland.ai/v1/agent-testing/scenarios/{id}/run")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/agent-testing/scenarios/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
"status": "RUNNING"
}
Agent Testing
Run Test Scenario
Execute a single test scenario. Returns immediately with a run ID while the test executes asynchronously.
POST
/
v1
/
agent-testing
/
scenarios
/
{id}
/
run
Run Test Scenario
curl --request POST \
--url https://api.bland.ai/v1/agent-testing/scenarios/{id}/run \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"version_number": 123,
"request_data_override": {},
"webhook_url": "<string>"
}
'import requests
url = "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run"
payload = {
"version_number": 123,
"request_data_override": {},
"webhook_url": "<string>"
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({version_number: 123, request_data_override: {}, webhook_url: '<string>'})
};
fetch('https://api.bland.ai/v1/agent-testing/scenarios/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version_number' => 123,
'request_data_override' => [
],
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v1/agent-testing/scenarios/{id}/run"
payload := strings.NewReader("{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bland.ai/v1/agent-testing/scenarios/{id}/run")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/agent-testing/scenarios/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version_number\": 123,\n \"request_data_override\": {},\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
"status": "RUNNING"
}
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The scenario ID to run.
Body
integer
Pathway version to test. Defaults to the current production version.
object
Override the scenario’s
request_data for this run. Any keys provided here will replace the corresponding keys in the scenario’s default request data.string
URL to receive a webhook when the run completes. The webhook payload will include the full run result.
Response
string
The unique identifier for the test run.
string
The current status of the run. Will be
RUNNING immediately after creation.{
"run_id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
"status": "RUNNING"
}
This endpoint is rate limited per organization. If you need to run multiple scenarios at once, consider using the Batch Run endpoint instead.
Docs for agents: llms.txt
Was this page helpful?
⌘I