Create a new assistant test
POST/ai/assistants/tests
Creates a comprehensive test configuration for evaluating AI assistant performance
Request
- application/json
Body
required
Array [
]
Possible values: non-empty
and <= 255 characters
A descriptive name for the assistant test. This will be used to identify the test in the UI and reports.
Possible values: <= 1000 characters
Optional detailed description of what this test evaluates and its purpose. Helps team members understand the test's objectives.
Possible values: [phone_call
, web_call
, sms_chat
, web_chat
]
Possible values: non-empty
The target destination for the test conversation. Format depends on the channel: phone number for SMS/voice, webhook URL for web chat, etc.
Possible values: >= 1
and <= 3600
Maximum duration in seconds that the test conversation should run before timing out. If not specified, uses system default timeout.
Possible values: <= 100 characters
Optional test suite name to group related tests together. Useful for organizing tests by feature, team, or release cycle.
Possible values: non-empty
and <= 5000 characters
Detailed instructions that define the test scenario and what the assistant should accomplish. This guides the test execution and evaluation.
rubric
object[]
required
Possible values: >= 1
Evaluation criteria used to assess the assistant's performance. Each rubric item contains a name and specific criteria for evaluation.
Label for the evaluation criterion, e.g., Empathy, Accuracy, Clarity.
Specific guidance on how to assess the assistant’s performance for this rubric item.
Responses
201: Returns the created test configuration with assigned test ID
- application/json
422: Validation Error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/ai/assistants/tests' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": [
"Customer Support Bot Test",
"Sales Assistant Evaluation"
],
"description": "string",
"telnyx_conversation_channel": "phone_call",
"destination": [
"+15551234567",
"assistant-id"
],
"max_duration_seconds": 0,
"test_suite": "string",
"instructions": [
"Act as a frustrated customer who received a damaged product. Ask for a refund and escalate if not satisfied with the initial response."
],
"rubric": [
[
{
"criteria": "Assistant responds within 30 seconds",
"name": "Response Time"
},
{
"criteria": "Provides correct product information",
"name": "Accuracy"
}
]
]
}'
Response samples
{
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot Test",
"description": "string",
"telnyx_conversation_channel": "phone_call",
"destination": "string",
"max_duration_seconds": 0,
"test_suite": "string",
"instructions": "string",
"rubric": [
[
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
]
],
"created_at": [
"2024-01-15T09:00:00Z"
]
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}