For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content
Phone TestingGenerate Phone Scenarios
TestMu AI
StatusCommunityBlog
Phone Testing

Generate Phone Scenarios

Generate phone test scenarios (inbound — the simulator calls the bot). Generation may run in the background; generated scenarios are saved automatically. Poll GET /api/projects/{project_id}/phone-scenarios/saved to retrieve them, and delete any you don't want to keep.

POST
/api/projects/{project_id}/phone-scenarios/generate
Generate Phone Scenarios
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/projects/{project_id}/phone-scenarios/generate" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"num_scenarios": 0,
"personas": [],
"special_instructions": "<special_instructions>",
"languages": [],
"needs_dtmf": true,
"dtmf_instructions": "<dtmf_instructions>",
"scenario_types": []
}'
{
"data": {
"scenarios": [
{
"scenario_id": "<string>",
"scenario": "<string>",
"prompt": "<string>",
"description": "<string>",
"persona": "",
"expected_output": [
"Agent should greet {{caller_name}} appropriately"
],
"success_criteria": [
"Agent should greet {{caller_name}} appropriately",
"Agent must verify {{account_id}} before disclosing balance",
"When asked for phone, agent should confirm {{phone_number}} matches records"
],
"required_test_fields": [
{
"field": "<string>",
"type": "string",
"purpose": ""
}
],
"optional_test_fields": [
{
"field": "<string>",
"type": "string",
"purpose": ""
}
],
"test_profile_id": "<string>",
"agent_profile_id": "<string>",
"reservation_enabled": false,
"max_duration_seconds": 123,
"silence_timeout_seconds": 123,
"needs_dtmf": true,
"dtmf_instructions": "<string>",
"needs_human_transfer": true,
"languages": [
"<string>"
],
"ivr_workflow": {},
"vapi_enabled_tool_ids": [
"<string>"
],
"vapi_tool_steps": [
{
"tool_id": "<string>",
"tool_name": "<string>",
"tool_type": "<string>",
"tool_description": "<string>",
"required": true,
"instruction": "<string>",
"expected_arguments": {}
}
]
}
]
}
}

Authorizations

Authorizationstringheaderrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

project_idstringrequired

Body

application/json
num_scenariosinteger

Number of scenarios to generate (1-20)

personasarray

List of personas to use for scenarios. If empty or None, all available personas will be used

special_instructionsstring

Special instructions for scenario generation, e.g., multilingual scenarios

languagesarray

List of languages to use for scenarios. If empty or None, default languages will be used

needs_dtmfboolean

When true, all generated scenarios will have DTMF enabled

dtmf_instructionsstring

IVR navigation instructions to store on each generated scenario (injected into prompt at call time)

scenario_typesarray

Optional subset of scenario generation types to focus on. Phone callers support 4: happy-path (plain/untagged baseline), negative, edge-case, red-team (integration is not applicable to voice). If empty or None, defaults to the full 4-type mix — happy-path stays plain, the other three are tagged. Send ['normal'] to force fully plain generation.

Response

application/json

Successful Response

dataobject

Generated phone scenarios

data.scenariosobject[]
Generate Phone Scenarios
curl --request POST \
--url "https://agent-testing.lambdatest.com/api/projects/{project_id}/phone-scenarios/generate" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"num_scenarios": 0,
"personas": [],
"special_instructions": "<special_instructions>",
"languages": [],
"needs_dtmf": true,
"dtmf_instructions": "<dtmf_instructions>",
"scenario_types": []
}'
{
"data": {
"scenarios": [
{
"scenario_id": "<string>",
"scenario": "<string>",
"prompt": "<string>",
"description": "<string>",
"persona": "",
"expected_output": [
"Agent should greet {{caller_name}} appropriately"
],
"success_criteria": [
"Agent should greet {{caller_name}} appropriately",
"Agent must verify {{account_id}} before disclosing balance",
"When asked for phone, agent should confirm {{phone_number}} matches records"
],
"required_test_fields": [
{
"field": "<string>",
"type": "string",
"purpose": ""
}
],
"optional_test_fields": [
{
"field": "<string>",
"type": "string",
"purpose": ""
}
],
"test_profile_id": "<string>",
"agent_profile_id": "<string>",
"reservation_enabled": false,
"max_duration_seconds": 123,
"silence_timeout_seconds": 123,
"needs_dtmf": true,
"dtmf_instructions": "<string>",
"needs_human_transfer": true,
"languages": [
"<string>"
],
"ivr_workflow": {},
"vapi_enabled_tool_ids": [
"<string>"
],
"vapi_tool_steps": [
{
"tool_id": "<string>",
"tool_name": "<string>",
"tool_type": "<string>",
"tool_description": "<string>",
"required": true,
"instruction": "<string>",
"expected_arguments": {}
}
]
}
]
}
}