curl -X POST https://api.playgent.com/v1/test-cases \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [
{
"input": { "text": "I want a refund for order #1234" },
"expected_behavior": "Agent should ask for order details and reason",
"scorers": ["relevance", "completeness"],
"ground_truth": "Order #1234 was placed on Dec 1, 2024 for $99.99",
"context": ["Order #1234: Status=Delivered, Amount=$99.99"]
}
],
"tags": ["customer-support", "refunds", "critical-path"]
}'
{
"id": "tc_xyz789",
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [...],
"tags": ["customer-support", "refunds", "critical-path"],
"created_at": "2024-12-16T10:00:00Z"
}
Test Cases
Create Test Case
Create a test case with multi-turn support
POST
/
v1
/
test-cases
curl -X POST https://api.playgent.com/v1/test-cases \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [
{
"input": { "text": "I want a refund for order #1234" },
"expected_behavior": "Agent should ask for order details and reason",
"scorers": ["relevance", "completeness"],
"ground_truth": "Order #1234 was placed on Dec 1, 2024 for $99.99",
"context": ["Order #1234: Status=Delivered, Amount=$99.99"]
}
],
"tags": ["customer-support", "refunds", "critical-path"]
}'
{
"id": "tc_xyz789",
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [...],
"tags": ["customer-support", "refunds", "critical-path"],
"created_at": "2024-12-16T10:00:00Z"
}
Create a test case to evaluate your agent. Supports single and multi-turn conversations.
string
required
Name for the test case
string
required
Agent to test against
string
Test type:
single or multi (default: single)array
required
Array of conversation turns
array
Tags for filtering and grouping test cases
string
required
Unique test case identifier
string
required
Test case name
string
required
Associated agent ID
string
required
ISO 8601 timestamp
curl -X POST https://api.playgent.com/v1/test-cases \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [
{
"input": { "text": "I want a refund for order #1234" },
"expected_behavior": "Agent should ask for order details and reason",
"scorers": ["relevance", "completeness"],
"ground_truth": "Order #1234 was placed on Dec 1, 2024 for $99.99",
"context": ["Order #1234: Status=Delivered, Amount=$99.99"]
}
],
"tags": ["customer-support", "refunds", "critical-path"]
}'
{
"id": "tc_xyz789",
"name": "Refund Request Flow",
"agent_id": "agent_abc123",
"type": "multi",
"turns": [...],
"tags": ["customer-support", "refunds", "critical-path"],
"created_at": "2024-12-16T10:00:00Z"
}

