Updates the fields you send and leaves the rest unchanged. The agent cannot be changed; create a new test case for another agent.
Request#
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Path parameter. The test_case_definition_id. |
Body (all optional, same rules as Create test case definition):
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | No | 1 to 120 characters. |
user_prompt |
string | No | 1 to 8000 characters. |
success_criteria |
string | No | 1 to 4000 characters. |
dynamic_variables |
object | No | Replaces all variables. |
tool_mocks |
array of objects | No | Replaces all tool mocks. |
llm_model |
string | No | Model for the simulated caller. |
agent_id in the body is ignored.
Example request#
curl -X PATCH https://api.tried.com.au/update-test-case-definition/test_case_8f7e6d5c4b3a29180f1e2d3c \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "success_criteria": "The agent books Thursday 10am and reads back \"Thursday 10am\"." }'const id = "test_case_8f7e6d5c4b3a29180f1e2d3c";
const res = await fetch(`https://api.tried.com.au/update-test-case-definition/${id}`, {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ success_criteria: 'The agent books Thursday 10am and reads back "Thursday 10am".' }),
});
const testCase = await res.json();import os, requests
test_case_id = "test_case_8f7e6d5c4b3a29180f1e2d3c"
res = requests.patch(
f"https://api.tried.com.au/update-test-case-definition/{test_case_id}",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
json={"success_criteria": 'The agent books Thursday 10am and reads back "Thursday 10am".'},
)
test_case = res.json()Response#
200 OK
{
"test_case_definition_id": "test_case_8f7e6d5c4b3a29180f1e2d3c",
"agent_id": "agent_3e4f5a6b7c8d9e0f1a2b3c4d",
"name": "Reschedule appointment",
"user_prompt": "You are Sam. You have a booking on Tuesday at 3pm. You want to move it to Thursday morning.",
"success_criteria": "The agent books Thursday 10am and reads back \"Thursday 10am\".",
"dynamic_variables": { "first_name": "Sam" },
"tool_mocks": [
{ "tool_name": "check_availability", "output": "{\"slots\":[\"Thursday 10am\"]}" }
],
"llm_model": "gpt-5.6-terra",
"created_timestamp": 1760850000000,
"last_modification_timestamp": 1760853600000
}The fields are described in Create test case definition.
Errors#
| Status | When |
|---|---|
400 |
Body fails validation, for example name: String must contain at least 1 character(s). |
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request, or the caller has the read-only member role. This route needs the agents scope. |
404 |
Test case <id> not found. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.
Retell compatibility#
Retell updates test cases with PUT. Tried uses PATCH on the same path, with the body described above.