Update test suite
curl --request PATCH \
--url https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Renewal objections (v2)",
"config": {
"max_parallel": 4
}
}
'import requests
url = "https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}"
payload = {
"name": "Renewal objections (v2)",
"config": { "max_parallel": 4 }
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Renewal objections (v2)', config: {max_parallel: 4}})
};
fetch('https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}', 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.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Renewal objections (v2)',
'config' => [
'max_parallel' => 4
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}"
payload := strings.NewReader("{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "test_suite_01hzy8x2m4q7r8s9t0v1w2x3y4",
"agent_id": "agent_sales_hi",
"name": "Renewal objections (v2)",
"scenarios": [
{
"label": "Price objection",
"instructions": "You are a budget-conscious customer who thinks the renewal price is too high.",
"runs": 2,
"max_turns": 8
}
],
"config": {
"judges": [
"task_completion",
"safety"
],
"variables": {
"company": "Acme"
},
"max_parallel": 4
},
"created_by_user_id": "user_01EXAMPLE",
"created_at": "2026-05-22T10:00:00Z",
"updated_at": "2026-05-22T10:20:00Z"
}{
"error": {
"code": "invalid_request",
"message": "name must be a non-empty string"
}
}{
"error": {
"code": "not_found",
"message": "Test suite not found"
}
}{
"error": {
"code": "conflict",
"message": "A test suite with that name already exists in this workspace"
}
}Agent Testing
Update test suite
Partially updates a test suite — send only name, scenarios, and/or config to change. Omitted fields are left untouched. Scope sessions:write.
PATCH
/
agent-test-suites
/
{suite_id}
Update test suite
curl --request PATCH \
--url https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Renewal objections (v2)",
"config": {
"max_parallel": 4
}
}
'import requests
url = "https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}"
payload = {
"name": "Renewal objections (v2)",
"config": { "max_parallel": 4 }
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Renewal objections (v2)', config: {max_parallel: 4}})
};
fetch('https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}', 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.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Renewal objections (v2)',
'config' => [
'max_parallel' => 4
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}"
payload := strings.NewReader("{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lehar.ai/ca/api/v0/agent-test-suites/{suite_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Renewal objections (v2)\",\n \"config\": {\n \"max_parallel\": 4\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "test_suite_01hzy8x2m4q7r8s9t0v1w2x3y4",
"agent_id": "agent_sales_hi",
"name": "Renewal objections (v2)",
"scenarios": [
{
"label": "Price objection",
"instructions": "You are a budget-conscious customer who thinks the renewal price is too high.",
"runs": 2,
"max_turns": 8
}
],
"config": {
"judges": [
"task_completion",
"safety"
],
"variables": {
"company": "Acme"
},
"max_parallel": 4
},
"created_by_user_id": "user_01EXAMPLE",
"created_at": "2026-05-22T10:00:00Z",
"updated_at": "2026-05-22T10:20:00Z"
}{
"error": {
"code": "invalid_request",
"message": "name must be a non-empty string"
}
}{
"error": {
"code": "not_found",
"message": "Test suite not found"
}
}{
"error": {
"code": "conflict",
"message": "A test suite with that name already exists in this workspace"
}
}Authorizations
ApiKeyAuthBearerAuth
Path Parameters
Body
application/json
Response
Updated test suite

